PaulS:
I say poorly-implemented, because the print() method should NOT be modifying the pointer, and should assure that it wont by making the argument const. But it wasn't properly written, so you have to work around it.
It should not be modifying what the pointer is pointing to.