Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!rt.uk.eu.org!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: C array descriptor Date: Thu, 26 Jun 2014 18:07:29 -0400 Organization: Aioe.org NNTP Server Lines: 42 Message-ID: References: <4cudnW5zj6HmfjbOnZ2dnUVZ_oSdnZ2d@supernews.com> NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:31895 On Thu, 26 Jun 2014 05:10:19 -0400, Andrew Haley wrote: > Rod Pemberton wrote: >> C doesn't have arrays either. > > Yes, it does. Read the standard, in particular 6.7.5.2, Array > declarators. > That's not array. It's a declarator. I mentioned that too: RP> "What C has is the ability to declare the space for an array." >> As you can clearly see, the "array" is *NOT* passed to a function >> and therefore shouldn't have "decayed into" a pointer to the first >> element. Yet, the "array" in the code body *IS* a pointer to the >> first element. > > No, it's not, it's an array. No, it's not, it's a pointer. Like I said. Your own quote agrees with me. You need to re-read this again: > As the standard puts it, > > "Except when it is the operand of the sizeof operator or the unary & > operator, or is a string literal used to initialize an array, an > expression that has type ''array of type'' is converted to an > expression with type ''pointer to type'' that points to the initial > element of the array object..." > ... > And this is exactly what happens at a function call. Like I said. It happens at compile time, long before a function call. C treats everything as pointer based. Rod Pemberton