|
get
Syntax:
#include <fstream> int get(); istream& get( char& ch ); istream& get( char* buffer, streamsize num ); istream& get( char* buffer, streamsize num, char delim ); istream& get( streambuf& buffer ); istream& get( streambuf& buffer, char delim ); The get() function is used with input streams, and either:
For example, the following code displays the contents of a file called temp.txt, character by character:
char ch;
ifstream fin( "temp.txt" );
while( fin.get(ch) )
cout << ch;
fin.close();
|