Date: Wed, 18 Feb 1998 10:17:45 +0200 (IST) From: Eli Zaretskii To: Donnie Roos cc: djgpp AT delorie DOT com Subject: Re: assigning the correct adress? In-Reply-To: <34e9a8df.2317141@news.rug.nl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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;