#ifdef __unix__
   #include <sys/types.h>
   #include <sys/stat.h>
#else
    #include <dir.h>
#endif
#include <stdio.h>
#include <stdlib.h>

int makedir(char *dir)
{
 if(mkdir(dir,0755) != -1)
  if(chdir(dir) != -1)
   return 0;
 return -1;
}

int main()
{
 char pfadname[200];

 printf("Wie soll der neue Ordner heißen : ");
 scanf("%s",pfadname);

 if(makedir(pfadname) == -1){
    fprintf(stderr,"Konnte kein neues Verzeichnis erstellen\n");
    exit(0);
    }
 /*testfile im Verzeichnis toll erstellen*/
 fopen("testfile","w");
 return 0;
}