hi i need help to sort a file in terms of CourseCode
i have this file COURSE.DAT
In the file this is the format....
<CourseCode>|<CourseName>|<SubjectArea>|<TeacherID|<Date>|<NoEnrolled>|<Support>
<CourseCode>|<CourseName>|<SubjectArea>|<TeacherID|<Date>|<NoEnrolled>|<Support>
eg of this file(raw)
CS10|Computing|CS|20845|12-12-2008|12|1
MA10|Mathematics|MA|20845|12-12-2008|12|1
PH11|Physics Practical|PH|20845|12-12-2008|12|1
CS11|Computing Practical|CS|20845|12-12-2008|12|1
PH10|Physics|PH|20845|12-12-2008|12|1
i need it to be sorted (the end result should be this
CS10|Computing|CS|20845|12-12-2008|12|1
CS11|Computing Practical|CS|20845|12-12-2008|12|1
PH10|Physics|PH|20845|12-12-2008|12|1
PH11|Physics Practical|PH|20845|12-12-2008|12|1
MA10|Mathematics|MA|20845|12-12-2008|12|1
Can anyone give me the code. i am using Microsoft Visual C++ 6.0
Please note the the number of records can be of any number(need not be 5).
I heard my fren say use strcmp and put it in array. And some of them saying to use bubble sort.
If anyone can give the solution...i will really be thankul to you!