Important MCQ

string s = "Hello"; s[0] is

Q.string s = "Hello"; s[0] is

A) o'
B) H'
C) e'
D) "Hello"
Correct Answer:
Option B
Detailed Explanation:
B) 'H' 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.