Q:

The following example uses the subscript operator to print the first character in a string

0

The following example uses the subscript operator to print the first character in a string.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

if (!s.empty()) // make sure there's a character to print
cout << s[0] << endl; // print the first character in s

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now