1 eatwhite
2 Get
3 Getline
4 Gcount
5 Ignore
6 operator>>
7 Peek
8 Read
9 SEEKG
Ten TELLG
1 eatwhite
Ignore leading spaces
2 Gcount
Count the last characters entered
3 Get
Extracting characters from a stream, including spaces
Std::cin.get (CH);//equivalent to Ch=std::cin.get;
1#include <iostream>2 3 voidMain ()4 {5 CharCH =0;6 7 while(ch! ='\ t')8 {9 std::cout.put (CH);TenStd::cin.Get(CH);//equivalent to Ch=std::cin.get; One } A -System"Pause"); -}
Interview, compound expression
1#include <iostream>2 3 voidMain ()4 {5 CharCH =0;6 7 while(ch = std::cin.Get()) !='\ t')//Compound Expressions8 {9 std::cout.put (CH);Ten } One ASystem"Pause"); -}
4 Getline
Extracts a line of characters from a stream
Std::cin.getline (str, 10);//Limit length, save 10-1 = 9 characters, last character is ' + ', function: Limit the length of the input password, prevent buffer overflow
1#include <iostream>2 3 voidMain ()4 {5 Charstr[ -] = {0 };6 7Std::cin.getline (str,Ten);//Limit length, save 10-1 = 9 characters, last character is ' + ', function: Limit the length of the input password, prevent buffer overflow8 9Std::cout <<str;Ten OneSystem"Pause"); A}
5 Ignore
Extracts and discards specified characters in a stream
6 operator>>
Extraction operators
7 Peek
Returns the next character in the stream, but does not remove it from the stream
8 Read
Unformatted Input byte count
9 SEEKG
Move the input stream pointer
Ten TELLG
Returns the pointer value for the specified position in the input stream
Public member functions of the IStream class