I am attempting to make life easier on myself, but pulling my hair out in the effort.
Here is what I would like to do... I would like the program to look for a text file in the folder and read information from that text file. That is no problem. However, if the program does not find the file name, I would like to allow for user inputs. I can get get each of these parts to work individually, but not together. I am attempting to us an 'if' statement to make this work.
Here is my code:
...
infile.open ("Fwd.par");
if(!infile)
{
std::cout << "*********" << endl;
std::cout << "**No parameter file was found.**" << endl;
std::cout << "Enter the name of the parameter file " << endl;
std::cin.getline(parfile,128);
std::cout << endl;
Any help you might be able to provide would be GREATLY appreciated! Note that if the parameter file is found (fwd.par) the program goes off without a hitch. Otherwise, I am able to input a parameter file, but the program does not seem to read it.