Sujet : Re: Command Languages Versus Programming Languages
De : jameskuyper (at) *nospam* alumni.caltech.edu (James Kuyper)
Groupes : comp.unix.programmerDate : 22. Nov 2024, 23:26:59
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vhr0fj$1bq0o$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
On 11/22/24 14:05, Dan Cross wrote:
In article <87h67zrtns.fsf@doppelsaurus.mobileactivedefense.com>,
Rainer Weikusat <rweikusat@talktalk.net> wrote:...
char **argv
>
declares an array of pointers
>
No, it declares a pointer to a pointer to char.
Agreed.
(as each pointer in C points to an array)
>
That's absolutely not true. A pointer in C may refer to
an array, or a scalar. Consider,
>
char c;
char *p = &c;
char **pp = &p;
Not actually relevant. For purposes of pointer arithmetic, a pointer to
a single object is treated as if it pointed at the first element of a
1-element array of that object's type.