Important MCQ

getline(cin, s); reads

Q.getline(cin, s); reads

A) nothing
B) only one word
C) a whole line including spaces
D) only a number
Correct Answer:
Option C
Detailed Explanation:
C) a whole line including spaces is correct. The string class is provided by . String indexes start at 0; length() and size() report character count, substr extracts part of a string, and getline reads spaces.