Deutsch English Français Italiano |
<20240710042117.423@kylheku.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.nobody.at!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Kaz Kylheku <643-408-1753@kylheku.com> Newsgroups: comp.lang.c Subject: Re: technology discussion =?UTF-8?Q?=E2=86=92?= does the world need a "new" C ? Date: Wed, 10 Jul 2024 11:27:09 -0000 (UTC) Organization: A noiseless patient Spider Lines: 46 Message-ID: <20240710042117.423@kylheku.com> References: <v66eci$2qeee$1@dont-email.me> <v67gt1$2vq6a$2@dont-email.me> <v687h2$36i6p$1@dont-email.me> <871q48w98e.fsf@nosuchdomain.example.com> <v68dsm$37sg2$1@dont-email.me> <87wmlzvfqp.fsf@nosuchdomain.example.com> <v6ard1$3ngh6$4@dont-email.me> <87le2eupl8.fsf@nosuchdomain.example.com> <v6l7o5$1poc2$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 10 Jul 2024 13:27:09 +0200 (CEST) Injection-Info: dont-email.me; posting-host="7b522d35a8b6a4705d66078d67bdff1e"; logging-data="1997954"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18fCb0WGaXoipiYSc2yqFAg6nIw7FC3SC8=" User-Agent: slrn/pre1.0.4-9 (Linux) Cancel-Lock: sha1:ZitLRHNjTO6olzBLyja2WoQK25g= Bytes: 2515 On 2024-07-10, Lawrence D'Oliveiro <ldo@nz.invalid> wrote: > On Sat, 06 Jul 2024 15:23:47 -0700, Keith Thompson wrote: > >> Lawrence D'Oliveiro <ldo@nz.invalid> writes: >> >>> On Fri, 05 Jul 2024 11:46:38 -0700, Keith Thompson wrote: >>> >>>> No, arrays are not pointers. >>> >>> Except array indexing is designed to be indistinguishable from pointer >>> arithmetic. >> >> No, arrays are not pointers. > > Can you point out any situation where this construct > > &a[b] > > might be valid, but this > > (a + b) > > (with the same declarations of “a” and “b”) might not? Miller Genuine Daft at work again. a[b] /means/ *(a + (b)) so your reasoning is circular. Arrays are not pointers. Given arrays a and b of equal size: - sizeof a is not sizeof &[0] other than by coincidence - &a is not &a[0] -- different type - a = b is invalid -- arrays are not modifiable lvalues - arrays cannot be passed to functions nor returned; pointers can. - int (f[3])(void) { }, function returning array of 3 int, is a constraint violation. -- TXR Programming Language: http://nongnu.org/txr Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal Mastodon: @Kazinator@mstdn.ca