delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/18/11:04:17

From: "Anthony.Appleyard" <MCLSSAA2 AT fs2 DOT mt DOT umist DOT ac DOT uk>
Organization: Materials Science Centre
To: d DOT roos AT st DOT hanze DOT nl (Donnie Roos), djgpp AT delorie DOT com
Date: Wed, 18 Feb 1998 08:07:52 GMT
Subject: Re: assigning the correct adress?
Reply-to: Anthony DOT Appleyard AT umist DOT ac DOT uk
Message-ID: <137BD761CC5@fs2.mt.umist.ac.uk>

  d DOT roos AT st DOT hanze DOT nl (Donnie Roos) wrote:-
> In my program I have a variable of word size (unsigned short)
> and two pointers which point to the two bytes of this word.
>     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 address 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 `&'". I've tried more () what ya call them? but it
> keeps complaining. Any help will be greatly appreciated. Donnie Roos.

     ptr_TMP_h = (ptr_TMP_l = (byte*)&reg_TMP) + 1;     ?????

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019