title: Warning: return from incompatible pointer type in C
body: <p>The below code generates an incompatible pointer type error and warning: control reaches end of non-void function in the filename function:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;    
  
  int quit;
  char *filename(int *);
  
  int main ()
  {   
      filename(&amp;quit);   
      return 0;
  }
  
  char *filename(int *i1)
  {
      char input[16];
      char *dum=(char*)malloc(16*sizeof(char));    
      if (dum==NULL){
          printf("Memory could not be allocated \n");
      }
      else {
          printf("Memory was allocated – remember to free\n \n");    
          *i1=1;    
          fputs("Input filename = ", stdout);
          fflush(stdout);
          fgets(input,sizeof(input),stdin);    
          printf("Filename = \"%s\"\n",input);   
          return i1;
  
      }
  }
  </code></pre>
  
  <p>I'm new to this, can someone help me with this error?</p>