+ 3
Why this prints 3?
#include <stdio.h> int main() { int a = (1,2,3); printf ("%d", a); return 0; }
3 Antworten
+ 6
Because it evaluates the last expression and returns it. So the last expression here is "3"
+ 5
A different behaviour found for C++ assignment operator, without the parentheses, the first value will be taken instead.
(Edit)
Apparently the same behaviour in C language.
https://code.sololearn.com/c3hQ2573ECgC/?ref=app
+ 4
https://www.sololearn.com/discuss/1672605/?ref=app