I'm trying to make a program which will create a sum of directories the user wants to create.
this is my code:
#include <cstdlib>
#include <iostream>
#include<windows.h>
using namespace std;
int main(int argc, char *argv[]) {
int nrDirs = 0;
cin>> nrDirs;
for (int i = 0; i <= nrDirs; i++) {
CreateDirectory ("C:\\Users\\myName\\Desktop\\new", NULL);
}
system("PAUSE");
return EXIT_SUCCESS;
}
Now my problem, I don't know how to rename the directory. I know how to do this in Objective-C:
"C:\\Users\\myName\\Desktop\\new%i", i
But this don't work in c++. :(
So how do i do this?