convert a string to lower case
for this activity,
you’ll be writing the function stringToLower
:
void stringToLower (char *buffer);
it takes a string in buffer
,
and changes all characters to lowercase.
you should always make sure that
your function maintains the null-terminator
at the end of the buffer
array.
this should look very similar to
the stringToUpper activity
you’ve just seen…
Download
stringToLower.c
,
or copy it into your current directory on a CSE system by running
$ cp /web/cs1511/17s2/week05/files/stringToLower.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 stringToLower
To run Styl-o-matic:
$ 1511 stylomatic stringToLower.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_stringToLower
Or, if you are working from home, upload the relevant file(s) to the wk05_stringToLower activity on Give Online.