CnUnix

[알림판목록 I] [알림판목록 II] [글목록][이 전][다 음]
[ CnUnix ] in KIDS
글 쓴 이(By): comeng (충대 컴공 ,�)
날 짜 (Date): 1994년02월03일(목) 16시37분52초 KST
제 목(Title): [Q] ++a + b + ++a




void main(void)
{
int a=0,b=3;
int c=0;

printf("%d\n",++a + b + ++a);

}

-------------------------------------------------------------------------------
If you compile this code in TC or Borand C ,  you can get 6 as the answer.
Why?-------------------------------------

void main(void)
{
int a=0,b=34;
int c=0;

c= ++a + b + ++a;
printf("%d\n",c);

}

--------------------------------------

And the result of the upper program is 7. Why? 
Why is there such discrepancy? 
[알림판목록 I] [알림판목록 II] [글 목록][이 전][다 음]
키 즈 는 열 린 사 람 들 의 모 임 입 니 다.