Code:
void functionInputFile(ifstream& infile) { string sti; //used for ask input file. string sto; //used for ask outputfile. cout<<"Enter the name of the input file where you want to read"; cin<<sti; cout<<"Enter the output file name: "; cin<<sto; infile.open(sti.c_str()); if(!infile) { cout<<"File does not exist"<<endl; } outfile.open(sto.c_str()); }//end of function Open file.
//Also I declared in the header of my program: #include <cstring>
#include <ifstream>
#include <iostream>
and I prototype my function to as: void functionInputFi le(ifstream& infile);
Comment