Sujet : Re: Top 10 most common hard skills listed on resumes...
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 10. Sep 2024, 00:53:12
Autres entêtes
Organisation : None to speak of
Message-ID : <87mskg1j13.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
User-Agent : Gnus/5.13 (Gnus v5.13)
Bart <
bc@freeuk.com> writes:
On 08/09/2024 17:44, Bart wrote:
On 08/09/2024 16:39, Ben Bacarisse wrote:
Bart <bc@freeuk.com> writes:
>
In language like C, the LHS of an assignment is one of four categories:
>
A = Y; // name
*X = Y; // pointer
X[i] = Y; // index
X.m = Y; // member select
>
I can think of three others. There may be more.
OK, so what are they?
>
TM:
Yes, very good. I count four or five, depending on what
differences count as different.
>
I guess nobody is going to say what those extra categories are, are they?
The LHS of an assignment must be a modifiable lvalue. Searching for the
word "lvalue" in the standard's section on expressions yields several
forms not listed above:
- A parenthesized lvalue:
(A) = Y;
- A generic selection whose result expression is an lvalue:
_Generic(0, int: A) = Y;
Not sure why you'd do this.
- X->m, where X is a pointer (you might think of that as the same
category as X.m, but the standard doesn't define the -> operator in
terms of the . operator)
- A compound literal:
int n;
(int){n} = 42;
This assigns a value to a temporary object which is immediately
discarded. I can't think of a valid use for this.
[...]
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */