CONVERT A STRING TO UPPER CASE

This is a pair exercise and must be competed in your tutorial or lab with your partner.

FOR THIS ACTIVITY, YOU’LL BE WRITING THE FUNCTION stringToUpper:

void stringToUpper (char *buffer);

IT TAKES A STRING IN buffer, AND CHANGES ALL CHARACTERS TO UPPERCASE. YOU SHOULD ALWAYS MAKE SURE THAT YOUR FUNCTION MAINTAINS THE NULL-TERMINATOR AT THE END OF THE buffer ARRAY.

Download stringToUpper.c, or copy it into your current directory on a CSE system by running

$ cp /web/cs1511/17s2/week05/files/stringToUpper.c .

WE’VE PROVIDED A SIMPLE TEST TO HELP YOU BUILD YOUR SOLUTION. YOU SHOULD WRITE MORE TESTS TO DEMONSTRATE YOUR SOLUTION WORKS.

To run some simple automated tests:

$ 1511 autotest stringToUpper

To run Styl-o-matic:

$ 1511 stylomatic stringToUpper.c
Looks good!

You’ll get advice if you need to make changes to your code.

Submit your work with the give command, like so:

$ give cs1511 wk05_stringToUpper

Or, if you are working from home, upload the relevant file(s) to the wk05_stringToUpper activity on Give Online.