Important MCQ

s.size() gives the same result as

Q.s.size() gives the same result as

A) s.empty()
B) s.substr()
C) s.length()
D) s.append()
Correct Answer:
Option C
Detailed Explanation:
C) s.length() 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.