Step: Brief Discussion
- cin.get(char &ch) : Adds a character at the end of variable
ch
- Puts the next input character in the variable ch. Returns an
integer value, which is zero if it encountered a problem (e.g.
end of file).
- cin.getline(char *buffer, int length)
- Reads characters into the string buffer, stopping when (a)
it has read length-1 characters or (b) when it finds an
end-of-line character ('\n') or the end of the file. Stores a
null character ('\0') after the last character read.
- cin.read(char *buffer, int n)
- Reads n bytes (or until the end of the file) from the stream
into the buffer.
- cin.gcount()
- Returns the number of characters read by a preceding get,
getline, or read command.
- cin.ignore(int n)
- Remove the next n characters (or until end of file) from the
input stream, throwing them away into the Great Bit Bucket.
- cin.putback(char ch)
- Puts character ch back onto the stream. Bad things will
happen if this character is not the one most recently extracted
from the stream.
|