/* ptrArith_1.c illustrates that the variable "word" is itself a pointer to char just like name. */ #include #include #include #define WORD_LENGTH 30 int main(int argc, char *argv[]) { char word[WORD_LENGTH]; /* Just to illustrate that "word" is a pointer too" */ *word = 'A'; /* same as word[0] = 'A' */ printf("word[0] = %c\n", *word ); /* "%c" formats 1 char, not a string */ strcpy(word,"Professor"); *(word + 4) = 'G'; /* same as word[4] = 'G' */ printf("word = %s\n", word); /* prints what? */ return 0; }