C-Style String Homework
- Write a program that reads a string from the keyboard and prints
out the string one word per line. Make your string large enough to
hold 80 characters.
- Write a function that takes two string parms. The function should make
the second string contain the reverse of the first string. For example,
if the first second string contains "yes i can", then the function
should set the first string to contain "nac i sey".
- Write a function Equal to test whether two strings are equal. Equal
should return 1 if the two string parms contain the same chars, and
return 0 otherwise.
- Write a function that has two parms: a string and a char. The
function should return the subscript of the first occurrence of
the char, or a –1 if the char is not in the string. For example, if
the string is "yes i can" and the char is 'c', the function should
return 6.
- Write a function trimfront that removes all leading blanks from
the string passed to it.
Email Me |
Office Hours |
My Home Page |
Department Home |
MCC Home Page
© Copyright Emmi Schatz 2003