Creating a Directory - C++ File Stream

C++ examples for File Stream:Directory

Description

Creating a Directory

Demo Code

#include <iostream>
#include <direct.h>
#include <cstring>
#include <errno.h>
#include <cstdlib>

using namespace std;

int main(int argc, char** argv) {
   if (mkdir("newFolder") == -1) {  // Create the directory
      cerr << "Error: " << strerror(errno);
      return(EXIT_FAILURE);
   }/*  w ww .  jav  a2  s  . c om*/
}

Related Tutorials