Quote:
The command line will have the executable file name (usually "a.out") as
well as two arguments:
1) an integer which is the number of strings to read from the file
2) an input filename
$ ./a.out 5 infile
There are several potential errors:
1) not enough command line arguments
2) integer not between 1 and 15
3) infile not able to be opened
4) not enough words in the file
Part I: Read the specified number of strings into a two-dimensional char
array (what may be considered a 1D array of strings). The maximum number of
strings is 15 and the maximum length of each is 20 (not including null).
It is perfectly acceptable if there are more than the specified number of
words in the file. Then sort ONLY the segment of the array which is being
used into ascending ASCII order. You must use a selection sort.
So I guess what' I'm wondering is how would this work in the openFile ( ) function? Or do I need to create another function for the checking of the command line arguments?