
Keith B. answered 09/06/19
Tutor
4.6
(22)
Software Engineer and Math Geek
Just did this yesterday, adding a toJSON() method - use the .str() method. This overloaded method returns a std::string when there's no argument, but the overloaded method accepts a text string that sets the object:
stringstream ss;
ss.str("");