Remember, pre-processor just replaces macros. So in your case you code will be converted to this:
#include <stdio.h>int main(){ unsigned int c = (1,2,3); unsigned int d = {1,2,3}; printf("%d\n",c); printf("%d\n",d); return 0;}
In first case, you get result from ,
operator, so c
will be equal to 3
. But in 2nd case you get first member of initializer list for d
, so you will get 1
as result.
2nd lines creates error if you compile code as c++
. But it seems that you can compile this code in c
.