Q:

As a another example, we’ll change the first word in s to all uppercase

0

As a another example, we’ll change the first word in s to all uppercase.

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 (decltype(s.size()) index = 0;
index != s.size() && !isspace(s[index]); ++index)
s[index] = toupper(s[index]); // capitalize the current character

 

Output:

SOME string

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