C-Style String Worksheet


  1. Write a function with one parameter - a C-style string. The function will print out the contents of the string, one character at a time. If the string is empty, your function should not print anything.

  2. Does your function need to know the size of the array that contains the string?

  3. Write a function with two parms. The first parm is a C-style string. The second parm is the maximum number of characters the string can hold. The function should use cin.get to read one word into the parameter. The function should skip any leading whitespace, and then read all characters up to the next whitespace. If the maximum number of characters is read, then the function should stop reading, if even white space has not been reached.



Email Me | Office Hours | My Home Page | Department Home | MCC Home Page

© Copyright Emmi Schatz 2002