#include #define SIZE 80 int main() { char word1[SIZE + 1]; int i; /* Assign character string to array, character-by-character for each element. You will learn in week 9's notes how to store character strings by prompt user and reading strings in by various methods including scanf, get, getchar, gets... */ word1[0] = 'I'; word1[1] = 'P'; word1[2] = 'C'; word1[3] = '1'; word1[4] = '4'; word1[5] = '4'; word1[6] = '\0'; /* Notice that the output of array word1 may look "strange" - again, that is because we are displaying entire contents of array (i.e. SIZE + 1). There is a better way - use the strlen() function that is used in next example "string_1.c */ printf ("\nContents of word1 array: "); for (i = 0; i < SIZE + 1; i++) printf ("%c", word1[i]); printf ("\n\n"); /* Note: When viewing non-printable characters using a.out | od -c you will notice a lot of null characters since we are printing out the ENTIRE contents of the array i.e. 81 elements (i.e. SIZE +1 ) elements in the array. It would be nice if we only print out the character string contents in the array - you will learn how to do this later by using the strlen() function later in these string examples */ }