I have a little problem in my C-Embedded software. In fact I would like to convert a char pointer on integer pointer but I encounter some issues...
In fact I fill a char-table and would like to read this buffer in integer variable. Could a cast permits to concatenate 4-char to one integer ?
Example:
char tab[4] = {0x01,0x02,0x03,0x04};
and I would like to get an integer containing the value 0x01020304
. I tried to do that but I don't get the wanted value:
val_int =*((int*)tab);
Could you give me some advice? Is it mandatory to cast each cell once?