#include <fstream> #include <iostream> using namespace std; int main() { const int max_count = 256; char line[ max_count ]; ifstream in( "a.out" ); while ( in.get( line, max_count ) ) { int count = in.gcount(); cout << "num of bytes read:" << count << '\n'; if ( count < max_count ) in.ignore(); } return 0; }