I am reading some data using an istream and read()
. I would like to know if I can just test gcount()
for the bytes or if I need to test some combination of good()
, eof()
, etc before calling gcount()
. In other words, is gcount()
always set after a read()
even if that read failed due to EOF or some other internal problem?
Also if this is described in the standard or somewhere that you can cite. I'm using cplusplus.com as a reference and it says that gcount
"Returns the number of characters extracted by the last unformatted input operation performed on the object." Can I interpret statements like "last operation" to mean last operation, whatever the outcome?