basic_istream::peek

To view the next character to be extracted.

int_type peek();

Remarks

The function peek() allows you to look ahead at the next character in a stream to be extracted without extracting it.

If good() is false returns traits::eof() else returns the value of the next character in the stream.

See Also

Example of basic_istream::peek() usage see basic_istream::ignore