Search
 
SCRIPT & CODE EXAMPLE
 

CPP

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);
}
Comment

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!";
    }
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: unordered_map of pair and int 
Cpp :: on component end overlap c++ 
Cpp :: compile cpp with specific version 
Cpp :: stoi c++ 
Cpp :: how to find index of a vector in c++ 
Cpp :: sfml set font 
Cpp :: priority queue ordered by second element 
Cpp :: c++ hello world program 
Cpp :: chess perft 5 
Cpp :: rotation to vector2 godot 
Cpp :: controlling in windows 
Cpp :: write a code that adds two number 
Cpp :: get ascii value of qchar 
Cpp :: how to load from files C++ 
Cpp :: cpp iterate words of string 
Cpp :: invalid next size (normal) c++ 
Cpp :: c++ default array value not null 
Cpp :: print 5 table in c++ 
Cpp :: C++ Converting Kelvin to Fahrenheit 
Cpp :: size of 2d array in c++ 
Cpp :: cpp random number in range 
Cpp :: std string to const char * c++ 
Cpp :: how to sort a vector in descending order in c++ 
Cpp :: OPA in expanse 
Cpp :: c++ user input 
Cpp :: c++ code for insertion sort 
Cpp :: opencv rgb to gray c++ 
Cpp :: how to find length of character array in c++ 
Cpp :: http.begin() error 
Cpp :: check if file is empty c++ 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =