[Exercise 14]

Use the C++ Standard Library

description | hints | solution | discussion
list of all exercises

a)Replace the struct List (or your own List<T>) by the standard STL container list<t> as well as our own String class by the C++ standard string class from exercise 6.
b)Experiment with different ways to to do the sorting:
  • write a (normal) function to sort by last name.
  • write a function object (functor) to sort by first name.

Additional hints

Solution:

Alternative solution:

Discussion of solution (*)