logo CodeStepByStep logo

crazyCaps

Language/Type: C++ string return
Related Links:

Write a function named crazyCaps that accepts a string reference as a parameter and changes that string to have its capitalization altered such that the characters at even indexes are all in lowercase and odd indexes are all in uppercase. For example, if a variable s stores "Hey!! THERE!", the call of crazyCaps(s); should change s to store "hEy!! tHeRe!".

Function: Write a C++ function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.