in reply to How to make object printable

Use overload to provide a stringification method for objects of your class. Then when you print them they will stringify using that method.