Path: utzoo!attcan!utgpu!watmath!rbutterworth From: rbutterworth@watmath.waterloo.edu (Ray Butterworth) Newsgroups: comp.lang.c Subject: Re: Clarification needed on Pointers/Arrays Message-ID: <23877@watmath.waterloo.edu> Date: 25 Feb 89 14:59:09 GMT References: <1436@etive.ed.ac.uk> <889@acf3.NYU.EDU> <11840@haddock.ima.isc.com> <3636@xyzzy.UUCP> Organization: U of Waterloo, Ontario Lines: 28 > sabbagh@acf3.NYU.EDU (sabbagh) >>>So what are arrays? They are POINTER CONSTANTS. > If you are trying to > USE C, then it's the perfect way to understand them. For those that STILL don't understand, consider this: int A[10]; float F; short S; What is A when evaluated in an expression? a constant pointer to an int. What is F when evaluated in an expression? a double. What is S when evaluated in an expression? an int. (see K&R, K&R2, pANSI, any C manual or tutorial for verification of this) So, if you really want to think of A itself as a pointer constant, then you'd better think of S itself as an int and F itself as a float. If so, you must really enjoy being confused. As for the rest of us: What is A? an array of 10 ints. What is S? a short int. What is F? a float. (see K&R, K&R2, pANSI, any C manual or tutorial for verification of this)