www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/20/11:34:22

To: djgpp AT delorie DOT com
Subject: Re: Custom Stack?
Message-ID: <19970220.081756.4935.1.chambersb@juno.com>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 970220090001 DOT 25071H-100000 AT is>
From: chambersb AT juno DOT com (Benjamin D Chambers)
Date: Thu, 20 Feb 1997 11:15:04 EST

On Thu, 20 Feb 1997 09:01:15 +0200 (IST) Eli Zaretskii
<eliz AT is DOT elta DOT co DOT il> writes:
>
>On Wed, 19 Feb 1997, Benjamin D Chambers wrote:
>
>> The problem seemed to go away when I used &buf[10] instead of 
>buf+40.
>> Don't ask me why.
>
>buf+40 is not the same as &buf[10], because of pointer arithmetics 
>rules.  &buf[10] is the same as buf+10 or (char *)buf + 40.
>
Except that buf is an int *, and each int is 4 bytes, right?  So wouldn't
that make it buf + 40?  Or does gcc automagically * size_of (or
whatever)?

...Chambers

- Raw text -


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