8

Is there posibility (any method) to check count of bytes read by function presented below:

istream& read (char* s, streamsize n);
CppMonster
  • 1,216
  • 4
  • 18
  • 35

2 Answers2

10
std::streamsize gcount() const;

Returns the number of characters extracted by the last unformatted input operation.

gcount

4pie0
  • 29,204
  • 9
  • 82
  • 118
2

you can use gcount

stream.read(x, sizeof x)
stream.gcount();
trubo
  • 29
  • 1