how to create a folder in C++
this might be a stupid question.but I really wanna know how I can create and delete a folder in C++.thanks in advance.
regards
It's platform-specific. mkpath for UNIX (look up the header), CreateFile for Windows.
Alternatively, you can cheat. Create a file using fstream and all the directories in the path will be created as well. Then use unlink to remove the file.
Alternatively, you can cheat. Create a file using fstream and all the directories in the path will be created as well. Then use unlink to remove the file.
Hi,
If you're talking about creating and deleting a directory in the exterior OS, and that OS is windows, then CreateDirectory and RemoveDirectory and your friends - a search on MSDN will probably find them (if not, have a look in Petzold).
If you're talking about creating and deleting a directory in the exterior OS, and that OS is windows, then CreateDirectory and RemoveDirectory and your friends - a search on MSDN will probably find them (if not, have a look in Petzold).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement