How do I create a directory or folder using C++?
Printable View
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
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");
You can also use:
#include <dir.h>
.
.
mkdir("a:\\dir_name");