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

C++
2

c++ how to check if ifle is opened

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 "c++ how to check if ifle is opened"

Browse Popular Code Answers by Language