Hello,
I am trying to store data within a char in C. Different types of data will be used, for example, strings and integers.
I have tried the following code:
char rawdata[4] = {0xfe, 0x01, 0x99, 0x42};
unsigned int *test = (unsigned int*) rawdata;
printf("%u\r\n", *test);
However, it returns the integer 1117323774 (hex: 42 99 01 fe). The integer that it should return is 4261517634 (hex: fe 01 99 42).
What would be the best way of doing this without returning the input backwards?
Regards,
John.