I just need to convert integer to hexadecimal. Actually I have a char array in which I am storing hex values.
int var;
var=[self getValue];
char hexValues[5];
he
a hex value IS an integer value
hexadecimal is just a way of displaying an integer.
if you want to create a string that is the hexadecimal representation of an integer, you can go:
char hexStr[20];
sprintf(hexStr,"0x%x",var);
you can also pad the number with zeros if you want, by going %0(total number of digits desired)x
eg:
int var = 0x123;
sprintf(hexStr,"0x%08x",var);
will result in hexStr being filled with "0x00000123"