All pastes #763056 Raw Edit

Unnamed

public cpp v1 · immutable
·published 2007-11-06 02:59 UTC
rendered paste body
// program 11.1// programmed by david bibb#include <iostream.h>#include <fstream.h>int main(){	ifstream ifile;	ofstream ofile;	char inputfile[13], outputfile[13], buffer[80];	cout << "Enter filename of input file: ";	cin.get(inputfile, 13);	cin.ignore(80, '\n');	cout << "Enter file to copy " << inputfile << " to: ";	cin.get(outputfile, 13);	cin.ignore(80, '\n');	ifile.open(inputfile, ios::in);	ofile.open(outputfile, ios::out);	if(ifile && ofile){		do{			ifile.get(buffer, 80);			ifile.ignore(80, '\n');			ofile << buffer << endl;		}		while(!ifile.eof());	}	else		cout << "An error occured while opening the file." << endl;	ifile.close();	ofile.close();	return 0;}