Most of that makes no sense.
Linked lists should not use the generic std::sort because "swapping" is done differently with links.
std::list has its own sort():
http://www.cplusplus.com/reference/list/list/sort/
You have a list of Containers. One would do it:
1 2
|
std::list<Container> something;
something.sort();
| |
If there is no operator< for Containers, or it does not suite the need, then you pass a different comparator to the sort().
If the Container has a list as a member
1 2 3
|
struct Container {
std::list<T> students;
};
| |
... and you want to sort students of each container:
1 2 3
|
for ( auto& cont : something ) {
cont.students.sort();
}
| |
sort(head[0]->student->getName[0], head[count]->student->getName[0]); //error |
Seriously? You say "error" and expect us to somehow explain the error message that you don't show?
No, if you do get an error message, then do show it.
That is the only way we can teach you how to read it.