C++

Objectives :

  • myFile_prinf_cout2.cpp
     
  • Introducing : int fgetpos(FILE *stream,fpos_t *pos ); 
    pros and cons of using <cstdio> and <iostream>
    FILE vs. Streaming
    printf vs. cout
    fgetpos( fp, &pos )
  • Inadequate buffer will put gibberish with cout
     fread( buffer, sizeof( char ),21, fp );
     fread( buffer, sizeof( char ),100, fp );
  • Code : myFile_prinf_cout2.txt 
 

Step: 1 Create a source file.

Create a text file

Step: 2 Edit and save Source file



 

Step: 3 Runtime Views:

Step: