title: making directory in C in linux
body: <p>I've a c program which create and works with files. how can tell  the prgram to read a file from a subdirectory and save another in 2 sub direct, here what I've tried:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;sys/stat.h&gt;
  
  int main (){
      char fileName1[10];
      char fileName2[10];
      FILE *in=NULL,*out=NULL;
      // making directory , input directotry exist as subdir in Program  folder  
      mkdir("ouput", 777);
      fileName1="//input//test";
      fileName ="//output//out1";
      ........................  
  }
  </code></pre>
  
  <p>after trying toopen the files nothing happens, and the directoty hasn't been created. any hint how can I do that ! 
  <strong>UPDATE</strong>
  the directory now is created but the file in it No ? </p>
  
  <p><strong>UPDATE</strong>
  MY fileName has any index so here is what I'm exactly doing :</p>
  
  <pre><code>while((access(fileName,F_OK)!=-1)){ // check if the file  already exist
      sprintf(fileName,"./output/sample%d",index++);  
  }
  </code></pre>
  
  <p>the making of the directory of the directory work but making the file in dir is the problem the program just crashes </p>