You are not the first one who is facing a problem. That's why I always share the solution of problems on my blog those I have faced. I believe someone will find these helpful.

Friday, March 21, 2008

Make a directory using C++ for windows

If you want to create a folder at windows using c++/cpp language, there is an easy way for make a folder. You can do it just including the <windows.h> header file. To make a folder at C:\ drive named "deadman"#include<windows.h>

int main(){ CreateDirectory ("C:\\deadman", NULL); return 0;}

If you want to delete a fodler from the C:\ directory.#include<windows.h>

int main(){ RemoveDirectory("C:\\deadman"); return 0;}

Also you can use the system command from c++ to create or delete a fodler. for examplesystem("mkdir c:\\deadman");