Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!gatech!cuae2!ihnp4!ihlpg!tainter From: tainter@ihlpg.UUCP (Tainter) Newsgroups: net.lang.c Subject: Re: Pointers and Arrays Message-ID: <2247@ihlpg.UUCP> Date: Wed, 23-Jul-86 18:01:50 EDT Article-I.D.: ihlpg.2247 Posted: Wed Jul 23 18:01:50 1986 Date-Received: Thu, 24-Jul-86 23:56:15 EDT References: <839@steinmetz.UUCP> <5814@alice.uUCp> Organization: AT&T Bell Laboratories Lines: 19 > > After five years of teaching C, I have to agree with my students that > > it makes no sense to forbid this construct. To take the address of > > something use the address operator. I have seen this mistake made by > > students from major universities, and graduates of courses taught by > > high priced consultants, so it's not just my students. > > All right, tell me: What is the type of the address of an array? > > That is, suppose I write: > > int a[10]; > > What type is &a? Don't tell me it's "pointer to integer" because > that is the type of &a[0], and a and a[0] are different things. The answer is : It doesn't have one. That isn't valid C. Compilers will give you warnings about this and interpret it as &a[0], or will give you an error message (or are broken!). --j.a.tainter