How do I create a directory or folder using C++?
How do I create a directory or folder using C++?
first, #include <stdlib.h>
then, under int main() {
system("mkdir Name");
I hope this helps
Website(s): http://www16.brinkster.com/trifaze/
E-mail: [email protected]
---------------------------------
C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
DirectX Version: 9.0b
DX SDK: DirectX 8.1 SDK
but what if I wanted to create it on another drive like A: would the coding be something like this?
system("A: mkdir name");
coz I tried that but it wouldnt work.
To create it on another drive, just #include <stdlib.h>, then I have, say, a folder named example:
to put 'example' on A:\
system("mkdir a:/example");
Website(s): http://www16.brinkster.com/trifaze/
E-mail: [email protected]
---------------------------------
C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
DirectX Version: 9.0b
DX SDK: DirectX 8.1 SDK
You can also use:
#include <dir.h>
.
.
mkdir("a:\\dir_name");