Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!purdue!haven!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.lang.c Subject: Re: "array" vs. "&array" ? Message-ID: <21621@mimsy.umd.edu> Date: 3 Jan 90 23:01:11 GMT References: <1989Dec22.013757.3086@sj.ate.slb.com> <571@mwtech.UUCP> <2368@ektools.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 19 In article <2368@ektools.UUCP> randolph@ektools.UUCP (Gary L. Randolph) writes: >3.) ANSI extended the language definition to allow taking the > address of an array name, so an ANSI conformant compiler will > now (correctly) yield pointer to array of T, or pointer to > pointer to T. There is no `or' about it! The result is a pointer to an array, NOT a pointer-to-pointer. The two types are completely different. POINTERS AND ARRAYS ARE NOT NOW AND NEVER HAVE BEEN EQUIVALENT IN C. There are a few special cases under which an object of type `array N of T' is converted to a value of type `pointer to T', and under which a declaration of type `array N of T' is converted to a declaration of type `pointer to T'. This does not make the types equivalent. They are not interchangeable. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris