Okay so heres my function I want it to open a file but if the file doesnt open i want it to do the else statement then start the function over again.
What would be the best method for doing so?
Im also open to critisism of currently existing code.
cout << "Enter in the name of the input file (ctrl-c to exit):";
cin >> fileName;
cout << fileName << endl;
ifstream myfile (fileName.c_str);
cout << "Input file " << fileName << " was successfully opened!" << endl << endl;
cout << "Error opening input file named: " << fileName << endl;
cout << "Please try again." << endl << endl;
} //end OpenFile