Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

If you want to examine an input value without actually removing it from the inpu

ID: 3696225 • Letter: I

Question

If you want to examine an input value without actually removing it from the input stream, you can apply a member function of cin to the variable ch, which you are to assume is a char type variable. Which of the following does this task ?
A cin.get(ch); B cin.put(ch); C cin.peek(ch); D cin.putback(ch); If you want to examine an input value without actually removing it from the input stream, you can apply a member function of cin to the variable ch, which you are to assume is a char type variable. Which of the following does this task ?
A cin.get(ch); B cin.put(ch); C cin.peek(ch); D cin.putback(ch);

Explanation / Answer

c) cin.peek(ch);