Four programs in C illustrating ways to implement reading and writing a list of words, in order of increasing sophistication. words1.c Quick and dirty, with the memory for the words in one contiguous block in main's stack. Input is done with scanf, which does not do any bounds checking; therefore, the charactrs input may overflow the buffer. words2.c Again all the memory is on the stack, but this time the words are accessed as rows of a matrix. The syntax is cleaner, though the storage is essentially the same. Input is done with fgets, which is safer since it can limit the number of bytes written memory. words3.c Now each word is first read into a temporary buffer (which can be larger than a typical word since only one is needed), and then copied to a block of memory allocated on the heap. The list of words is stored as a fixed length array of pointers to characters, and is thus itself a pointer to a pointer. words4.c Finally, a full-fledged linked list defined via structs puts a list of arbitrary length onto the heap, in pieces which point to each other. The size input buffer still sets a limit on the word size.