Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!mcnc!rti!xyzzy!throopw From: throopw@xyzzy.UUCP (Wayne A. Throop) Newsgroups: comp.lang.c Subject: Re: Clarification needed on Pointers/Arrays Message-ID: <3636@xyzzy.UUCP> Date: 24 Feb 89 21:46:55 GMT References: <1436@etive.ed.ac.uk> <889@acf3.NYU.EDU> <11840@haddock.ima.isc.com> <890@acf3.NYU.EDU> Organization: Data General, RTP NC. Lines: 24 > sabbagh@acf3.NYU.EDU (sabbagh) >>>So what are arrays? They are POINTER CONSTANTS. >>Urk. While this is true in a sense, it's been my observation that people who >>think of them that way are taking the wrong path to understanding. > Hmm. It depends on what you are trying to understand. If you are trying to > USE C, then it's the perfect way to understand them. How then to account for their behavior with "sizeof"? I recommend thinking of them not AS pointer constants, but as (almost) universally CONVERTED TO pointer constants. That accounts for their behavior in sizeof, and even in multiply-dimensioned arrays (that is, if you have an array of arrays, you have an array of... constants??? nah!). So again... it's not that arrays ARE pointer constants, but that they are CONVERTED TO pointer constants (almost always). This seems to me to be the least confusing way of thinking about it while using C. -- All things scabbed and ulcerous, All pox both great and small, Putrid, foul and gangrenous, The Lord God made them all. --- Monty Python -- Wayne Throop !mcnc!rti!xyzzy!throopw