Can you write something like this in C with multiple assignment operations?
int a = 0, b = 0, c = 0, d = 0;
(((a = b) = c) = d);
I’ve read somewhere that C standard states that the result of this won’t be lvalue? is this undefined?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do
which is the same as
As you say, the (sub-)expression
(a = b)is not an lvalue and can’t be assigned a value.