Home Forums C Programming need hlep in file handling

Viewing 0 reply threads
  • Author
    Posts
    • #2004
      bala
      Participant

      hi,
      i write a program but it doen’t work well .hlep to indentify my mistake program is

      #include
      #include
      main()
      {
      FILE *fptr;
      char ch="NULL",*name;
      printf("Enter the name for file :");
      scanf("%s",name);

      fptr=fopen(name,"a+");

      if (fptr==NULL)
      {
      printf("File does not existn");
      exit(1);
      }
      while(1)
      {
      /*gets(ch);*/
      if (gets(&ch) == 'n')
      break;
      else
      {
      putc(ch,fptr);
      }
      }

      fclose(fptr);
      getch();
      }

      ………………………………if u find any mistake mail me at [email protected]

Viewing 0 reply threads
  • The forum ‘C Programming’ is closed to new topics and replies.