// main.cpp // ---------------------------------------------------------------------- // driver for Course struct sorting, printing, etc. // // CSE 143 // Homework 1 // http://www.cs.washington.edu/education/courses/143/00su/homework/hw1/ // 20 Jun 2000 #include #include "course.h" void waitForChar(void) { char junkchar; cout << endl << "Type a character and ENTER to end... "; cin >> junkchar; } int main() { Course courseList[MAX_COURSE_COUNT]; char fileName[MAX_NAME_LENGTH]; cout << endl << "Name of file with course information? "; cin >> fileName; cout << endl; int courseCount; // number of courses read from the file readCourseFile(fileName, courseList, MAX_COURSE_COUNT, courseCount); if (courseCount < 0) { waitForChar(); return -1; // error } sortCourseListByName(courseList, courseCount); printCourseList(courseList, courseCount); sortCourseListByTime(courseList, courseCount); printCourseList(courseList, courseCount); // the array is still sorted by times reportTimeConflicts(courseList, courseCount); waitForChar(); return 0; } // end main