Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>istream::gcount</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
istream::gcount

Usage

   #include <iostream.hpp>
   int istream::gcount();

Description

   May be called after any of the unformated input functions (get, getline,
   read) to determine how many characters were transferred. gcount()  should
   be called immediately after the unformatted input function, since
   formatted input functions may use the unformatted functions, and thus
   reset the value.

Example 

   ifstream ifs("things.dat");

   ifs.read(&x, sizeof(Thing));

   if (ifs.gcount() != sizeof(Thing))  // something wrong





Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson