I am wondering what does a[3] = (a[1], a[2]);
does in the following code. It returns a[3] = 0
. And if I eliminate the parentheses, a[3] = a[1]
and a[2]
doesn't change its value.
Thank you!
#include <stdio.h>
int main(int argc, char ** argv) {
int a[4] = { 100, 200 };
a[3] = (a[1], a[2]); // What happens here?
printf("%d %d %d %d\n", a[0], a[1], a[2], a[3]);
return 0;
}