J
James A
Hi,
I'm having trouble geting my head around this, although I know it's a pretty
basic question.
I have an application whereby an area of RAM is mapped to an array:
unsigned char NV[128];
Two consequtive elements are used to hold an unsigned int (2 bytes on this
platform). How do I access it as an unsigned int?
e.g.
unsigned int test;
....
test = *(unsigned int *)(&(NV[15]);
In this case, I'm trying to retrieve the unsigned int value represented by
elements 15 & 16 of the array. It does not seem to be working.
Could someone please explain what I'm doing wrong.
Many thanks,
James
I'm having trouble geting my head around this, although I know it's a pretty
basic question.
I have an application whereby an area of RAM is mapped to an array:
unsigned char NV[128];
Two consequtive elements are used to hold an unsigned int (2 bytes on this
platform). How do I access it as an unsigned int?
e.g.
unsigned int test;
....
test = *(unsigned int *)(&(NV[15]);
In this case, I'm trying to retrieve the unsigned int value represented by
elements 15 & 16 of the array. It does not seem to be working.
Could someone please explain what I'm doing wrong.
Many thanks,
James