🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #9160

Re: Pointers and Arrays

#9160
From: karl
Date: Wed, 20 Aug 1986 01:40
15 lines
1341 bytes
dg_rtp!throopw (Wayne Throop) writes:
>And [in ANSI C] it's still a little difficult to get an array-typed
>rvalue, so assignment still doesn't work, even aside from the fact that
>ANSI doesn't make array-typed lvalues modifiable.

I've got some ideas about that, but the first step is to deprecate the
"feature" that allows you to write "f(int a[])" for "f(int *a)".  (I refer
here to the declaration of the function, not its call.)  In my mind, since
arrays may not currently be passed as arguments, the declaration is an error,
and the compiler is "politely" figuring out what you must have *meant*.  As
has already been pointed out, "sizeof(a)" gives you "sizeof(int *)" in this
context, so the apparent acceptance of the declaration tends to be confusing.

Karl W. Z. Heuer (ihnp4!ima!haddock!karl), The Walking Lint
Technical Details
Message-ID: <86900020@haddock>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!think!ima!haddock!karl
References: <513@hadron.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!think!ima!haddock!karl
From: karl@haddock
Newsgroups: net.lang.c
Subject: Re: Pointers and Arrays
Message-ID: <86900020@haddock>
Date: Tue, 19-Aug-86 21:40:00 EDT
Article-I.D.: haddock.86900020
Posted: Tue Aug 19 21:40:00 1986
Date-Received: Wed, 20-Aug-86 22:46:48 EDT
References: <513@hadron.UUCP>
Lines: 15
Nf-ID: #R:hadron.UUCP:513:haddock:86900020:000:822
Nf-From: haddock!karl    Aug 19 21:40:00 1986