Show a null-terminated letter array

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

In this activity, you will need to complete a function that displays an array of char values as text. Your function will not be given the number of characters to show, instead, you must display characters from the string until you find a Null Terminator character ('\0') in the string.

You should use the putchar() function for this activity. This function puts a single character on the screen.

The starting file has been given for you.

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

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

Some example arrays have been provided for you.

To run some simple automated tests:

$ 1511 autotest showTerminatedLetters

To run Styl-o-matic:

$ 1511 stylomatic showTerminatedLetters.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_showTerminatedLetters

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