Sujet : Re: Regarding assignment to struct
De : Muttley (at) *nospam* dastardlyhq.com
Groupes : comp.lang.cDate : 05. May 2025, 09:50:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vv9u4v$46n9$1@dont-email.me>
References : 1 2
On Sat, 3 May 2025 11:46:30 +0200
David Brown <
david.brown@hesbynett.no> gabbled:
On 02/05/2025 20:34, Lew Pitcher wrote:
Back in the days of K&R, Kernighan and Ritchie published an addendum
to the "C Reference Manual" titled "Recent Changes to C" (November 1978)
in which they detailed some differences in the C language post "The
C Programming Language".
The first difference they noted was that
"Structures may be assigned, passed as arguments to functions, and
returned by functions."
From what I can see of the ISO C standards, the current C language
has kept these these features. However, I don't see many C projects
using them.
>
>
I use these features regularly. I have no problem passing structs around if that is the convenient way to structure the code.
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.