Anyone knows how to sort arrays of structures?
Hie there...
Does anyone here knows how to sort arrays of structures in ascending and descending order?In the simplest way?
For example my structure lookes like this:
Code:
struct Course{
char name[50];
char id[10];
char grade[3];
};
struct Record{
char name[30];
long int id;
char year[10];
char major[10];
float gpa;
struct Course course_taken[6];
};
If i declare struct Record student[10] ,how can i sort the members for all student[10] and display in ascending or descending ?Can i use Insertion sort?Coz that looks easier for a newbie like me, but i don't know how to use insertion sort to sort strings.. :confused:
hope to get some reply here...thanks