/* ECE 264 Yung-Hsiang Lu, Purdue Spring 2009 */ #include #include #include char * findWord(char * str, int nthword) { /* find the n-th word in str */ /* If str has so many words, return a pointer. */ /* If str does not have so many words, return 0. */ /* consider to use strchr */ return str; } int compareString(/* arguments */) { /* find the n-th words in str1 and str2 and compare them */ return 1; } void sortString(/* arguments: the lines, how many lines, and which word is used for comparison */) { /* replace integer comparison by string comparison */ /* swap the strings, if necessary */ } void printString(/* arguments: the lines and how many lines */) { printf("\n"); } int main(int argc, char * argv[]) { /* check the input arguments */ /* open input file */ /* read the file line by line (at most 60 characters per line, ignore the rest if the line is longer) */ /* sort the lines based on the n-th words */ /* print result */ /* release memory, if necessary */ return 0; }