Conversion of Hexa Value in String From to Primitive Hexavalue.

Hi,

In My Program I have HEXA value in a string array as below :

char hexa="0xabcd1234"; //This is how I'm getting source data.

Actaully I want this hexa value to be decremented with -1
and store it in another string as "0xabcd1234".

Can any body help me how to do that..?
I tried...but was not able to ..

Thanks in Advance.
Regards

S.VISHWANATH.

Hi,

Well I got that..
But still thanks if you have taken look into this.

Here is how I got that..

char hexa[]="0xabcd1234";
char hexa1[10];
sprintf(hexa1,"0x%x",strtoul(hexa,(char**)NULL,16)-1);
printf("\nHexa1--->%s\n",hexa1);