/**************************************************************************** * string1.c * * Computer Science 50 * David J. Malan * * Prints a given string one character per line. * * Demonstrates strings as arrays of chars and use of strlen. ***************************************************************************/ #include #include #include int main(int argc, char * argv[]) { char c; int i; string s; /* get line of text */ s = GetString(); /* print string, one character per line */ if (s != NULL) { for (i = 0; i < strlen(s); i++) { c = s[i]; printf("%c\n", c); } } }