C++

Objectives :

  • myFile_fgetc1.cpp
    reading text file with fgets and fgetc
  • comparing these functions
    int fgetpos(FILE *stream,fpos_t *pos );
    int fgetc(FILE *stream );
    char *fgets( char *str, int n,FILE *stream };
  • properties of these functions
    fgets : builds  a string from a stream.
    fgetc: Reads a character from a stream.
  •  Code: myFile_fgetc1.txt
 

Step: 1 Create a source file.

Create a text file

 

Step: 2 Edit and save Source file

Step: 3 Runtime Views:

Step: