Exercise solution:
Another example/exercise with C++ references