#include <string>#include <iostream>#include <fstream>using namespace std;int main(){ string Word; int retval=0; ofstream outfile("outfile.txt"); ifstream infile("infile.txt"); if(!outfile) { cerr << "can not create outfile."<<endl; retval = -1; } if(!infile) { cerr << "can not create infile."<<endl; retval = -1; } while (infile >> word) { outfile << word << ' '; }
system("PAUSE"); return retval;}