I want to check the file name given as argv[1] and make sure that it is a file that actually exists in the folder. For simplicity sake, I have the below program to output all the lines in the file, but I would like to check that the file exists before doing that.
int main(int argc, const char *argv[])
{
ifstream settings(argv[1]);
string s = "";
while (settings)
{
getline(settings, s);
cout << s << endl;
}
}