Help me convert decimal number to hexadecimal number

I want to convert decimal number to hexadecimal number and recovert it.
example
if I get 3F I want to convert it to 63.(convert decimal number to hexadecimal number)
and if I get 160 I want to convert it to A0. (convert hexadecimal number to decimal number)

Thank you

Comments

  • : I want to convert decimal number to hexadecimal number and recovert it.
    : example
    : if I get 3F I want to convert it to 63.(convert decimal number to hexadecimal number)
    : and if I get 160 I want to convert it to A0. (convert hexadecimal number to decimal number)
    :
    : Thank you
    :
    :

    To convert from decimal to hex:
    char buf[16];
    int x = 63;
    sprintf(buf,"%X",x);
    convert it back to decimal
    x = 0;
    sscanf(buf,"%X", &x);


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion