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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!