good

get

#include <iostream>int get();istream &get(char &ch): istream &get(char *buf, streamsize num); istream &get(char *buf, streamsize num, char delim ); istream &get(streambuf &buf); istream &get(streambuf &buf, char delim);

The get( ) function is a member of istream.

In general, get( ) reads characters from an input stream. The parameterless form of get( ) reads a single character from the associated stream and returns that value.

get(char &ch) reads a character from the associated stream and puts that value in ch. It returns a reference to the stream.

get(char *buf, streamsize num) reads characters into the array pointed to by buf until either num–1 characters have been read, a newline is found, or the end of the file has been encountered. The array pointed to by buf will be null terminated by get( ). If the newline character is encountered in the input stream, it is not extracted. This function returns a reference to the stream.

get(char *buf, streamsize num, char delim) reads characters into the array pointed to by buf until either num–1 characters have been read, the character specified by delim has been found, or the end of the file has been encountered. The array pointed to by buf will be null terminated by get( ). If the delimiter character is encountered in the input stream, it is not extracted. This function returns a reference to the stream.

get(streambuf &buf) reads characters from the input stream into the streambuf object. Characters are read until a newline is found or the end of the file is encountered. It returns a reference to the stream. If the newline character is encountered in the input stream, it is not extracted.

get(streambuf &buf, char delim) reads characters from the input stream into the streambuf object. Characters are read until the character specified by delim is found or the end of the file is encountered. It returns a reference to the stream. If the delimiter character is encountered in the input stream, it is not extracted.

Related functions are put( ), read( ), and getline( ).




C(s)C++ Programmer's Reference
C Programming on the IBM PC (C Programmers Reference Guide Series)
ISBN: 0673462897
EAN: 2147483647
Year: 2002
Pages: 539

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net