Creating a directory with ofstream is not possible. It is mainly used for files. There are two solutions below:
Solution 1:
#include
int _tmain() {
//Make the directory
system("mkdir sample");
}
Solution 2:
#include
int _tmain() {
CreateDirectory("MyDir", NULL);
}