I am pretty new to C, I used the search function but I didn't have any luck finding the legality and the use of && in C.
The question that this arises from is quite vague and some insight would be great!
Is the expression on the second line legal? Why or why not? What does it mean?
int x;
... &&x ...
From what I have been able to come up with and search around for was that this is a legal statement and it gets the address of the label x , although to me this does not seem like the correct representation.
It could be legal, but not in the way you're thinking.
&&
is the "logical and" operator. It could be legal in your example depending on what's in the ...
.
As a unary "address of" operator it's not legal, since &x
will be an "rvalue" and not define storage. Therefore, a second &
will not be allowed.