Hi
I have written a code,in which i have hard coded hex values to a array (a[5]).I need these hex values which i have given to this array as ouput.On compiling the code,i am getting the converted values of these hex to int (e.g. 0x001 =1,0x002 = 2,0x0a4 = 164).
How can i get the given hex values as output without the conversion taking place?
Code:
#include <stdio.h>
int main(void) {
int i;
unsigned char a[5]={0x0a4,0x002,0x003,0x004};
unsigned char p[i];
for(i=0;i<4;i++)
{
p[i]=a[i];
// printf("%c",p[0]);
// memcpy(p[i],a[i],strlen(a[i]+1));
printf("\n%d",p[i]);
}
//return 0;
}
pls help?!