[STL] Adding structs as nodes

Hi m new to stl

I have this structure declared

struct myStruct {
char firstname[20];
char lastname[20];
int grade;
};
list<myStruct> names;

instead of using an array of struct can i declare is as a STL list so that i can use the algorithm such as sort.. (sort the list by lastname and grades)

how do i add a set of names n grade in the list .. using the push methods of list? it would really make my life easier with your help guys.. Thanks a bunch!
See replies on your duplicate post : http://www.cplusplus.com/forum/beginner/3396/

Topic archived. No new replies allowed.