c ++ in ios related base conversion functions

oct ------> octal
dec -------> decimal
hex ------> hex
control input and output formats:

int main()
{
    int a = 0;
    cin >>hex>>a;
    cout << dec<< a;
    system("pause");
    return 0;
}

Enter hexadecimal to decimal output.

Guess you like

Origin blog.51cto.com/14239789/2446777