Mail Archives: djgpp/1998/02/18/08:39:25
On Tue, 17 Feb 1998, Donnie Roos wrote:
> word TMP;
> byte *ptr_TMP_l, *ptr_TMP_h;
>
> In my code i try to assign it in the following way.
> It needs a cast to increase the adress by 1 byte instead of a word.
>
> ptr_TMP_l = & (byte) reg_TMP;
> ptr_TMP_h = & (byte) reg_TMP + 1;
>
> When compiling my source from RHIDE (default options) i get the
> message: invalid lvalue in unary `&'
Warning: UNTESTED code follows!!
typedef unsigned char byte;
typedef unsigned short word;
word TMP;
byte *ptr_TMP_l, *ptr_TMP_h;
...
ptr_TMP_l = (byte *)&TMP;
ptr_TMP_h = ptr_TMP_l + 1;
- Raw text -