check if directory exists cpp
#include <sys/stat.h>
bool IsPathExist(const std::string &s)
{
struct stat buffer;
return (stat (s.c_str(), &buffer) == 0);
}
check if directory exists cpp
#include <sys/stat.h>
bool IsPathExist(const std::string &s)
{
struct stat buffer;
return (stat (s.c_str(), &buffer) == 0);
}
how to find out if a directory exists in cpp
#include <sys/stat.h>
int main() {
struct stat buffer;
std::string string = "Hello";
if (stat(&string.c_str(), &buffer) != 0) {
std::cout << "'Hello' directory doesn't exist!";
} else {
std::cout << "'Hello' directory exists!";
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us