|
streambuf::sungetcpublic member function
int sungetc ( ); Decrease get pointer Moves the get pointer one character backwards, making the last character gotten by an input operation available once again for the next input operation.During its operation, the function will call the protected virtual member function pbackfail if the get pointer gptr points to the same position as the beginning pointer eback. ParametersnoneReturn ValueThe value of the character in the new get pointer position.If the get pointer is at the beginning of the input sequence the function returns EOF (or traits::eof() for other traits). Example
This example gets characters form standard input one by one. When the first numeric digit is found, sungetc is called to restore the position in the stream to that digit in order to be extracted as part of a number using the extraction operator >>. Basic template member declaration( basic_streambuf<charT,traits> )
See also
|