Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void openInput(ifstream& inFile)
- {
- string inputFile;
- while(true)
- {
- cout<<endl;
- cout<<"Enter name of input file or Control-C to quit program: ";
- cin>>inputFile;
- cout<<inputFile<<endl;
- cout<<endl;
- inFile.open(inputFile.c_str());
- if(inFile.fail())
- {
- cout<<"*************** File Open Error ***************"<<endl;
- cout<<"==> Input file failed to open properly!!"<<endl;
- cout<<"==> Attempted to open file: "<<inputFile<<endl;
- cout<<"==> Please try again..."<<endl;
- cout<<"***********************************************"<<endl;
- }
- else
- {
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement