Closed corya14 closed 10 years ago
Damian said you could literally just take the stuff being printed out in the printInfo functions and just convert it to a string.
Sure man, I'm in the middle of this good life essay, but once I finish I'll get to work on that.
On Sunday, April 13, 2014, corya14 notifications@github.com wrote:
Damian said you could literally just take the stuff being printed out in the printInfo functions and just convert it to a string.
— Reply to this email directly or view it on GitHubhttps://github.com/COP3503Group3-4/Calculator-Project/issues/4#issuecomment-40318221 .
string Log::toString(){
ostringstream logString;
logString<<"log_"<
This is the example I have for Log. Every value has a printInfo method, ostringstream, just concatenates everything. If this doesn't work, just make a string that is equal to (in this example, logString).str() and then return that string. You need to include
Alright Hayden, I dun fucked up. My printInfo methods return void, so I need to change them to return a string...fuck.
Hayden, can you go into Value, create a virtual method just like printInfo that returns a string called toString, and then implement it for each value.
Ex: RationalNumber's toString would just return "number" where number is the internal number
Fraction's toString would return "(numerator/denominator)"
Log's would return "log_base:num"
etc..