Ignoring variable types, is this expression like a=b=cthat defined behavior in both C and C ++?
a=b=c
If so, can someone give me an official certificate, for example, quotes from the standard?
PS I was looking for a seconded assignment, but all I have is associativity, but I did not find any text about this in the C99 standard. Maybe I did it wrong? hoping someone could help me.
From the C ++ standard
5.17 [expr.ass] 1 (=) . lvalue lvalue, . -, . , , .
int a, b; a = b = { 1 }; // meaning a=b=1;
C
6.5.16 3 , . , 111) , lvalue. - lvalue. . .
, . ++ lvalue, , C , 111) , lvalue.
, ++
int a, b = 20; ( a = 10 ) = b;
C .
. a=b=c a=(b=c). (b=c) (b).
a=(b=c)
b=c
b
C ++, , ,
a=b=c;
:
a=(b=c);
b=c , b . , " " ( ) ++, , - !
. 6.5.16 (3) C99:
, [...]
Together with the right-associative assessment and assuming non-volatile a, band c, this means that it is a = b = cequivalent a = (b = c)and again equivalent b = c; a = b.
a
c
a = b = c
a = (b = c)
b = c; a = b
Source: https://habr.com/ru/post/1533154/More articles:The getInstance method (byte []) is undefined for the type Document .. Android - androidadding droidtext image not working - javaCan I configure ArangoDB to take graph database snapshots at a specific time? - nosqlR random forest: data (x) has 0 rows - rThe return value from the method if the method throws an exception - c #Find the closest value in the matrix matrix - matrixjBPM 6.0 ksession clustering - jbpmAndroid library project says nullpointerexception - androidНет видимого @interface для 'GPUImageOutput' объявляет селектор 'imageFromCurrentlyProcessedOutputWithOrientation:' - iosSitecore - return to parent bucket - c #All Articles