The only thing left now is to verify our program. We will run the program with these command-line arguments in the following order:
- sortNames
- sortNames -o sorted.data
- sortNames -i names.data
- sortNames -i names.data -o sorted data
In each test case, we will enter the names Tom, Dick, and Jane. The names.data file should be left over from when we ran createUnsorted.c earlier and contain five names. You should see the following output from the first case:
You should see the following output from the second test case:
The names.datafileshould still exist from our earlier test. Here, we use it as input and see that we've sorted those five names, as follows:
In the last case, we...