Write a program that reads text from one file and writes an edited version of the same text to another file. The edited version is identical to the unedited version except that every string of two or more consecutive blanks is replaced by a single blank. Thus the text is edited to remove any extra blank characters. The program should define a function that is called the input and output-file streams as arguments. Make up a test file to see if it works.
I have the following code already written, but I am not sure how to get it to read a test file, how do I specify the path so that it will automatically find the correct path.
cout<<"Enter a file name. 12 characters or less<<endl;
cout<<"Cannot open outfile.data Aborting.!!!"<<endl;
cout<<"Cannot open file"<<"Aborting."<<endl;
cout<<"Average of"<<count<<"number is"<<average<<endl;
output<<"Average of"<<count<<"number is"<<average<<endl;