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::get</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
istream::get

Usage

   #include <iostream.hpp>
   istream &istream::get(char &c);
   istream &istream::get(char *dest, int length, char delim = '\n');
   istream &istream::get(streambuf &sb, char delim = '\n');

Description

   The unformatted input get functions call the istream prefix function with
   argument value zero, which means that no whitespace stripping takes
   place, so these input functions are essentially binary or raw.

   The first of them extracts a single character, and places it in the
   referenced variable.

   The second stores characters in the indicated array, dest, until either
   the character nominated as delimiter is encountered (the delimiter is
   defaulted to the newline character), or until length-1 characters have
   been extracted, or until an end of file condition is encountered. A null
   terminating character is then stored in the array.

   The third version extracts characters and places them in the specified
   streambuf until the delimiter character is encountered, or an EOF
   condition is encountered on thre destination streambuf.

   The failbit flag is set if no characters can be got before and end of
   file condition.

   The number of characters transferred can be determined by an immediately
   following call to gcount().

Example 

   // Input stream contains
   // "The quick brown fox! - jumped or not?"

   char buffer[80];

   cin.get(buffer,80, '!');
   // gets "The quick brown fox" into buffer

Return Value

   The get functions return a reference to the ostream object for which they
   are called.





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