Octal is just a number format for writing text.
a function like
Code:
int octalDay(int day)
{
cout.setf(ios_base::oct);
return day;
}
does nothing. an int is an int is an int!
Code:
int x = 255 // == 0xFF == 0377
if you want to convert a int (binary value) to an octal string (text representation) use a stringstream or other way
Code:
stringstream str;
string test;
int x = 255;
str << x;
str >> oct >> test; // test == "0377"
str << x;
str >> hex >> test; // test == "0xFF"
str << oct << "10";
str >> x; // x == decimal 8
str << x;
str >> dec >> test; // test == "8"