📜  如何找出 cpp 中是否存在目录 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:15.191000             🧑  作者: Mango

代码示例2
#include 

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