Answers for "how to check if file is opened c++"

C++
2

how to check if file is opened c++

ifstream file;
file.open(argv[1]);
if (!file.is_open()) { 
  cerr << "File did not open";
  exit(1); 
}
Posted by: Guest on March-20-2021

Code answers related to "how to check if file is opened c++"

Browse Popular Code Answers by Language