/* * Author: D. Sheets * Description: Simple string example program */ #include int main() { /* Which of these are valid ways to declare strings? */ char str1[] = "string one"; char str2[] = { 's', 't', 'r', '2', '\0' }; char str3[10] = "string3"; char str4[10] = { 's', 't', 'r', 'i', 'n', 'g', '4', '\0' }; char str5[20]; char str6[]; char str7; printf("%s\n", str1); printf("%s\n", str2); printf("%s\n", str3); printf("%s\n", str4); printf("%s\n", str5); printf("%s\n", str6); printf("%s\n", str7); return(0); }