To check if a file exists in C++ you can use the following snippet.
Sample C++
#include <sys/stat.h> inline bool fileExists (const std::string& fileName) { struct stat buff; return (stat (fileName.c_str(), &buff) == 0); }
To check if a file exists in C++ you can use the following snippet.
#include <sys/stat.h> inline bool fileExists (const std::string& fileName) { struct stat buff; return (stat (fileName.c_str(), &buff) == 0); }