The sortNames()program is still relatively simple. However, we are beginning to build segments of code that are very much unlike each other. For instance, the file handling code, which includes getName(), putName(), and trimStr(), is unrelated to the linked list handling code, which we will soon develop.
We could, as we have done many times before, dump all of this code in a single file, happily compile it, and run it. Or, which is a much more common practice, separate different code segments into separate files so that all of the functions in any given file have a logical relationship. For the sortNames program, the logical relationships are that all of the functions in one file manipulate one kind of structure, the linked list, and all of the functions in another file manipulate file I/O. Among all of the source code files, there must be one and only one main(). All of the files together make up a program. We will explore this in much...