C-Style String Worksheet
- Declare a string variable named phrase that can hold up to 80
characters.
- Declare a string variable named again that can hold up to 30
characters. Initialize again so that it contains your name.
- Prompt the user to enter their favorite phrase and read the
response into the string phrase. Make sure you can read a phrase that
contains more than one word
-
Print out the phrase that the user entered in the previous problem.
-
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.
-
Does your function need to know the size of the array that contains
the string?
- 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".
Email Me |
Office Hours |
My Home Page |
Department Home |
MCC Home Page
© Copyright Emmi Schatz 2002