What is the easiest way to convert string holding octal number into string holding decimal representation of the same number?
I could convert it into int value using strtol, then convert into string again using stringstream:
string oct_number("203");
// converts into integer
int value = strtol(oct_number.c_str(), NULL, 8);
// converts int to decimal string
stringstream ss;
ss << value;
string dec_number = ss.str();
But: is there any quicker way to do it? I have a rather poor understanding of the stringstream class, am I missing something?