title: Return char array??(C)
body: <p>I'm new at programming. I have:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt; // With luck, this declares strdup()
  
  enum { ROWS = 50 };
  
  static char *funkc(FILE *fp,char file[50])
  {
      int q,row;
      char charbuffer[2],ch,*map[ROWS];
  
      ch=getc(fp);
      q=1;
      while (ch!=EOF){
          ch=getc(fp);
          q++;
      } 
  
      for (row = 0; row &lt;=q; row++){
          map[row] = "  ";
      }
      fp = fopen(file, "r");
  
  
      for (row = 0; row &lt;= q; row++) {
          if (fgets(charbuffer, 2, fp))
              map[row] = strdup(charbuffer);
      }
  
      for (row = 0; row &lt;= q; row++) {
          printf("%s", map[row]);
      }
      return map[3];
  }
  
  int main(void)
  {
      char *map2[ROWS];
      FILE *fp;
      char file[50]; // Unused variable *map[ROWS];
      printf("file name \n");
      scanf("%s",file);  // Removed ampersand from file
      if ((fp=fopen(file,"r"))==NULL)
      {
          printf("Error \n");
          exit(1);
      }
  
      map2[0]=funkc(fp,file);
      printf("%s",map2[0]);   // Add missing semicolon
      return 0;
  }
  </code></pre>
  
  <p>With that I can return only single char but I need to return full char array (map[ROWS]); how can I do it?</p>