微软的 Surface RT 有自带的中文菜单马?# Hardware - 计算机硬件
L*e
1 楼
I know for y=x++, definitely a temp variable holds the old value.
How about this: for(int i=0;i<100;i++) or even simpler i++?
From the claim from http://www.gotw.ca/gotw/002.htm, but I do not agree this claim, why a temp var is created but not used at all? see the following sample program and generated assembly.
Any thoughts?
int i = 0;
i++;
++i;
int k=i++;
assembly generated by g++:
movl $0, -12(%ebp) #, i
addl $1, -12(%ebp) #, i
addl $1, -12(%ebp)
How about this: for(int i=0;i<100;i++) or even simpler i++?
From the claim from http://www.gotw.ca/gotw/002.htm, but I do not agree this claim, why a temp var is created but not used at all? see the following sample program and generated assembly.
Any thoughts?
int i = 0;
i++;
++i;
int k=i++;
assembly generated by g++:
movl $0, -12(%ebp) #, i
addl $1, -12(%ebp) #, i
addl $1, -12(%ebp)