/* MALLOC DEMO #0 illustrates: use of malloc use of free */ #include #include #include #define MAX_WORD_LENGTH 30 int main(int argc, char *argv[]) { char wordArray[MAX_WORD_LENGTH]; /* a string */ char *word; /* also a string, of length ? */ printf("Enter a word (<%d chars): ", MAX_WORD_LENGTH); scanf("%s", wordArray); word = wordArray; printf(" you entered: %s\n", word); return 0; }