Q:

Using the increment operator, we can rewrite our program that changed the case of the first word in a string to use iterators instead

0

Using the increment operator, we can rewrite our program that changed the case of the first word in a string to use iterators instead.

All Answers

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

// process characters in s until we run out of characters or we hit a whitespace
for (auto it = s.begin(); it != s.end() && !isspace(*it);
++it)
*it = toupper(*it); // capitalize the current character

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