此C代码的输出不确定

时间:2012-07-24 04:29:50

标签: c

  

可能重复:
  Could anyone explain these undefined behaviors (i = i++ + ++i , i = i++, etc…)
  Why does sizeof(x++) not increment x?

这里i的值是5,但我猜它应该是6或7。是什么原因?

int main(void){
    int i=5,j;
    j=sizeof(i++ + ++i);
    printf("%d %d",i,j);
}

0 个答案:

没有答案