title: Writing a file using fopen function
body: <p>I wrote the following C program to write data into a file.The program got compiled properly but nothing is getting written in the file.Please suggest modifications if required.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;errno.h&gt;
  
  int main()
  {
      int i;
      FILE *fopen(),*fp;
      fp = fopen("D:\Satish_SharedSubstance\V13.4-CT_Testing\LONGRUN_Testing\writetest.txt","w");
      /*Create a file and add text*/
      if(fp!=NULL)
      {
          fprintf(fp,"GRP \n");
          fprintf(fp,"groupname group_1 \n");
          fprintf(fp,"groupcomment group_1\n");
          fprintf(fp,"jobnet 255 \n");
          fprintf(fp,";\n");
          for (i=1;i&lt;=255;i++)
          {
              fprintf(fp,"GNT \n");
              fprintf(fp,"jobnetname jobnet_t%d\n",i);
              fprintf(fp,"jobnetnumber %d\n",i);
              fprintf(fp,";");
          }
          /*writes data to the file*/
          fclose(fp); /*done!*/ 
      }
      else
      {
          printf("Error opening file\n");
      }
      return 0;
  } 
  </code></pre>