Important MCQ

Which header is needed for the string class?

Q.Which header is needed for the string class?

A) <ctime>
B) <string>
C) <iomanip>
D) <cmath>
Correct Answer:
Option B
Detailed Explanation:
B) 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.