delorie.com/archives/browse.cgi | search |
Date: | Thu, 20 Feb 1997 19:01:18 +0200 (IST) |
From: | Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> |
To: | Benjamin D Chambers <chambersb AT juno DOT com> |
cc: | djgpp AT delorie DOT com |
Subject: | Re: Custom Stack? |
In-Reply-To: | <19970220.081756.4935.1.chambersb@juno.com> |
Message-ID: | <Pine.SUN.3.91.970220185918.27109H-100000@is> |
MIME-Version: | 1.0 |
On Thu, 20 Feb 1997, Benjamin D Chambers wrote: > >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)? Of course, it does. Every C compiler does that. That's what I meant when I said ``pointer arithmetics rules''.
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |