home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mitech!gjc
- From: gjc@mitech.com (George J. Carrette)
- Newsgroups: vmsnet.internals
- Subject: Re: C Language question
- Message-ID: <3067@mitech.com>
- Date: 9 Oct 92 14:32:00 GMT
- References: <718580974.504412.MILLER@TGV.COM>
- Organization: Mitech Corporation, Concord MA
- Lines: 24
-
- In article <718580974.504412.MILLER@TGV.COM>, MILLER@TGV.COM writes:
- > Remember: a[i] really means *(a+i) using the rules for pointer addition.
- > a[i] is a macro construct.
- > So a[i][j] really works out to *((char *)&*(a+i) + j), I think.
-
- Hey, the guy who said to ask this on comp.lang.c is only 50%
- correct. This is FAQ item!
-
- But anyway, not true in all cases. In other words, if you see this in a program:
-
- a[i][j]
-
- you don't really know if it means reference a vector of vectors or not.
-
- It all depends on how a was declared. If char a[][], or char **a, that
- is one thing.
-
- But, it may also have been declared char a[5][10]. In which case
- the resulting memory operations are more like what you would expect from
- FORTRAN. Not two memory references but one.
-
- The is one of the funky things about the C programming language.
-
- -gjc
-