How to create a folder on a Mac with C++?

前端 未结 2 507
伪装坚强ぢ
伪装坚强ぢ 2021-01-24 13:33

How do you have the user input the folder name and have it created in the desktop (for mac)? This is what I have so far.. (and extra code underneath)

#include &         


        
2条回答
  •  天涯浪人
    2021-01-24 13:55

    Use Boost Library (though there will be overhead of setting up boost on your system but its worth for doing many other stuffs in C++): boost::filesystem::create_directories()

    #include 
    
    // your code....
    
    boost::filesystem::create_directories("/bla/a");
    

提交回复
热议问题