Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: usecases of void foo(char **b) {} Date: Wed, 02 Nov 2016 12:55:51 -0700 Organization: None to speak of Lines: 42 Message-ID: References: <49899127-bf04-4a84-a374-5bebfbe7f4f7@googlegroups.com> <2bf83e98-eb96-4ab6-b1ca-4e6a8bd824f5@googlegroups.com> <5b33a608-8f61-4ea0-be08-080018f5772c@googlegroups.com> <87mvhjo3jw.fsf@bsb.me.uk> <3a09f5ec-d4f7-40fa-9855-b5c3f02ce4e9@googlegroups.com> <87ziljks6k.fsf@bsb.me.uk> <2199a2dd-d844-4f8d-bfe0-6a7c2854277b@googlegroups.com> <87twbqlsin.fsf@bsb.me.uk> <87oa1yljof.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="55d562a779fc0ae2b1f2a983cf45db85"; logging-data="7665"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/WYi4aQDvvYJw6CwMFAk06" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:aeFfiDfKXJUkuZyu7JjlBddy58Q= sha1:ZqFPi+44GXIsbAVTEvzuNggYLD0= Xref: csiph.com comp.lang.c:95614 BartC writes: > On 02/11/2016 16:17, Keith Thompson wrote: >> BartC writes: >>> On 02/11/2016 02:06, Ben Bacarisse wrote: >>>> BartC writes: >>> >>>>> It seems to me that they are problematic as you don't often see code >>>>> like this: >>> >>>>> (*A)[i]; // A is pointer to array >>> >>>>> You will see instead: >>> >>>>> A[i]; // A is now pointer to array element, and is now >>>>> // indistinguishable from a regular array >>> >>>>> If the syntax for the first set hadn't involved those parentheses, >>>> >>>>> then probably it wouldn't have been necessary to invent the forms in >>>>> that middle set. >>>> >>>> Are you trying to spread more disinformation by suggesting that A[i] is >>>> an alternative, parenthesis free, version of (*A)[i]? >>> >>> Yes, exactly that. Or at least when the A in A[i] is a pointer to an >>> array element. >> >> I believe Ben was asking if you're suggesting that A[i] and (*A)[i] are >> actually equivalent in C. > > I was suggesting they are used for the same ends. Given what declaration of A? Or do you need to change how A is defined? Once again, you cannot in general understand an expression without seeing the relevant declarations. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"