Question: Whats is a toString() in c++? example code: class RGBColor { short red; short green; short blue; std::string name; public: RGBColor(std::string n, int r, int
Whats is a toString() in c++?
example code:
class RGBColor { short red; short green; short blue; std::string name; public: RGBColor(std::string n, int r, int g, int b); short getRed() const; short getGreen() const; short getBlue() const; std::string getName(); *** std::string toString();***im stuck here
Whats the purpose of this? Do I use this as a get and set method in my class? how do i respond to this tostring() in my code?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
