String Conversion Workarounds and to_string()
In this lesson, you’ll see common workarounds to the problem highlighted in the last lesson. You’ll see two ways in which string conversions inside a class can be done. The first way is to reach into the class and print out attributes directly and the second method is to use a custom
to_string() method to print out a string representing the class.
Become a Member to join the conversation.