¿Cómo averiguar si existe una carpeta y cómo crear una carpeta?

Estoy tratando de crear una carpeta si no existe. Estoy usando Windows y no estoy interesado en que mi código funcione en otras plataformas.

No importa, encontré la solución. Estaba teniendo un problema de inclusión. La respuesta es

#include <io.h>   // For access().
#include <sys/types.h>  // For stat().
#include <sys/stat.h>   // For stat().
#include <iostream>
#include <string>
using namespace std;

string strPath;
   cout << "Enter directory to check: ";
   cin >> strPath;

   if ( access( strPath.c_str(), 0 ) == 0 )
   {
      struct stat status;
      stat( strPath.c_str(), &status );

      if ( status.st_mode & S_IFDIR )
      {
         cout << "The directory exists." << endl;
      }
      else
      {
         cout << "The path you entered is a file." << endl;
      }
   }
   else
   {
      cout << "Path doesn't exist." << endl;
   }

Respuestas a la pregunta(3)

Su respuesta a la pregunta