/* StringFunctions.c (c) Kari Laitinen http://www.naturalprogramming.com/ 2013-11-25 File created. 2013-11-25 Last modification. */ #include #include int main() { char name_of_user[ 40 ] ; char first_part_of_sentence[] = "\n This program shows you, "; char third_part_of_sentence[] = ", the string functions." ; char sentence_to_screen[ 100 ] ; printf( "\n Please, type in your name: " ) ; gets( name_of_user ) ; strcpy( sentence_to_screen, first_part_of_sentence ) ; strcat( sentence_to_screen, name_of_user ) ; strcat( sentence_to_screen, third_part_of_sentence ) ; printf( "%s", sentence_to_screen ) ; printf( "\n\n By the way, your name has %d characters. \n", strlen( name_of_user ) ) ; } /* Here is a sample run of this program: Please, type in your name: Kari This program shows you, Kari, the string functions. By the way, your name has 4 characters. */