the syntax for calling a void function, not a value-returning function. The function call is a complete statement; it is not part of a larger expression.
The effect of the above function call is to input the next character waiting in the streameven if it is a whitespace character like a blankand store it into the variable someChar. The parameter to the get function must be a variable, not a constant or arbitrary expression; we must tell the function where we want it to store the input character.
Using the get function, we now can input all three characters of the input line
R 1
We can use three consecutive calls to the get function
cin.get(ch1);
cin.get(ch2);
cin.get(ch3);
or we can do it this way:
cin >> ch1;
cin.get(ch2);
cin >> ch3;
The first version is probably a bit clearer for someone to read and understand.
Here are some more examples of character input using both the >> operator and the get function. All of ch1, ch2, and ch3 are char variables. As before, \n denotes the newline character.