code 1:
#include<stdio.h>
int main(void)
{
int a;
a= 1,2,3;
int b = a++;
printf("%d",b);
return 0;
}
code 2 :
#include<stdio.h>
int main(void)
{
int a;
a= (1,2,3);
int b = a++;
printf("%d",b);
return 0;
}
Can you please explain why that bracket is making ouput changed ? i know comma operator wrokd from left to right. but why that thing is not working for first case ? thanks alot in advance.
what i am thinking is that = has more precedence than comma. so it is attached to that more tightly. but then is it looking like this.
((((a=1),2),3));
so after assigning them, why 2,3 is acceptable to compiler ? why is it nor giving error ? thanks.