Today's Question:  What does your personal desk look like?        GIVE A SHOUT

Make a directory using C++ for windows

  Demon        2012-02-25 04:26:16       16,828        1    

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 example
system("mkdir c:\\deadman");

Source:http://icfun.blogspot.com/2008/03/make-directory-using-c-for-windows.html

WINDOWS  C++  EXAMPLE  DIRECTORY  CREATEDIRECTORY 

Share on Facebook  Share on Twitter  Share on Weibo  Share on Reddit 

  RELATED


  1 COMMENT


Anonymous [Reply]@ 2016-11-19 14:47:11

Thanks