Liste des Groupes | Revenir à cl c |
On Fri 5/2/2025 11:34 AM, 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.
Weird. Virtually every C project relies on assignment of
structures. Passing-returning structs by value might be more rare
(although perfectly valid and often appropriate too), but
assignment... assignment is used by everyone everywhere without even
giving it a second thought.
>
One dark corner this feature has, is that in C (as opposed to C++) the
result of an assignment operator is an rvalue, which can easily lead
to some interesting consequences related to structs with arrays
inside.
Les messages affichés proviennent d'usenet.