| Deutsch English Français Italiano |
|
<20250506163456.000053a1@yahoo.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Michael S <already5chosen@yahoo.com> Newsgroups: comp.lang.c Subject: Re: Regarding assignment to struct Date: Tue, 6 May 2025 16:34:56 +0300 Organization: A noiseless patient Spider Lines: 19 Message-ID: <20250506163456.000053a1@yahoo.com> References: <vv338b$16oam$1@dont-email.me> <vv4olm$388j7$1@dont-email.me> <vv9u4v$46n9$1@dont-email.me> <877c2uhj9l.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Date: Tue, 06 May 2025 15:34:57 +0200 (CEST) Injection-Info: dont-email.me; posting-host="1fbabcc8cc389706c2c5c5cf67d6c256"; logging-data="2655731"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+EGLGaLFiLtdGVb0j2tohX155ywTTu0HE=" Cancel-Lock: sha1:JBM+FwTAxpFlM6R4105NW/eA35U= X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32) Bytes: 1850 On Mon, 05 May 2025 13:53:10 -0700 Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote: > Muttley@dastardlyhq.com writes: > [...] > > If you twant o pass an actual array to a function instead of a > > pointer to it, embedding it in a structure is the only way to do > > it. > > Yes, but that's not necessarily useful. An array that's a member > of a struct can only be of a constant length (unless it's a flexible > array member, but that doesn't help). Functions that work with > arrays typically need to deal with arrays of arbitrary length. > It seems, C++ authorities were feeling that the pattern "struct with array of constant length as an only member" is very common. Otherwise they wouldn't bother to add <array> to their standard library.