[Solved]Another pointer/casting question.

Hi all, I know I should know this but I am doing something stupid apparently, would somebody mind pointing me in the right direction please?

If I have a char array like this :-

BC FA 0F 50 FF 21 13 00 1B 0F 10 50 FF 21 16 00 
0E 2A 10 50 FF 21 1C 00 09 52 10 50 FF 21 22 00 
07 8C 10 50 FF 21 2B 00 CA E6 10 50 FF 21 38 00 
D7 7C 11 50 FF 21 4A 00 E4 82 12 50 FF 21 70 00 
5E D0 14 60 E6 00 40 01 5E 0F 17 60 E6 00 40 01

I would like to access it as 4byte integers, I have tried (uint32_t)&array[5] , uint32_t(char*)(&array[5]), uint32_t(&array+20)

Is it possible to read the first 4 bytes BC FA 0F 50 as a 32bit int? I am decidedly poor with pointers...

Thanks,

Graham

You mean like ((uint32_t*)array)[0] ?

@Septillion,

Brilliant!! THANK YOU.

+1

Graham