Open a file: how to use fopen : File Open « File « C / ANSI-C






Open a file: how to use fopen



#include <stdio.h>
int main ()
{
  FILE *file;
  file = fopen ("my.txt","wt");
  
  if (file!=NULL)
  {
    fputs ("Hiiiiiiiiiiiii",file);
    fclose (file);
  }
  return 0;
}

           
       








Related examples in the same category

1.Get file name from command line and open the file
2.Open a file and close it
3.Reopen a file
4. Reopen a stream with a different file and mode: how to use freopen
5.Open a file for read