Question: how to check if a directory exists in c++ in windows?
Answer: #include <windows. h> #include <string> bool dirExists(const std::string& dirName_in) { DWORD ftyp = GetFileAttributesA(dirName_in. c_str()); if (ftyp == INVALID_FILE_ATTRIBUTES) return false; //something is wrong with your path! if (ftyp & FILE_ATTRIBUTE_DIRECTORY) return true; // this is a directory!