Important MCQ

s.empty() returns true when

Q.s.empty() returns true when

A) the string has no characters
B) the string has digits
C) the string is very long
D) the string has spaces
Correct Answer:
Option A
Detailed Explanation:
A) the string has no characters 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.