Make a directory using C++ for windows

  Demon        2012-02-25 04:26:16       17,107        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

C++  DIRECTORY  WINDOWS  CREATEDIRECTORY  EXAMPLE 

       

  RELATED


  1 COMMENT


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

Thanks



  RANDOM FUN

Be serious, Google

This is the Google doodle in Hong Kong for 2014 Mid-Autumn festival. Are you serious, Google? Do Chinese need to climb the ladder to see the moon? Are you meaning that the Chinese need to bypass the Great Firewall to use Google?