user-0 提问: 关于C中 i++ 与 ++i的问题

回复:
user: user-0
content: 受教了 http://bbs.csdn.net/topics/370153775

user: user-0
content: 引用 7 楼 zhao4zhong1 的回复:http://bbs.csdn.net/topics/370153775 二楼  引用printf("i,i++,i++ = %d,%d,%d\n",i,i++,i++); 代码是错的 结果没意义  基于结果得到的结论也没意义  怎么错的 看置顶帖 二楼

user: user-1
content: http://bbs.csdn.net/topics/370153775

user: user-0
content: 引用 3 楼 user-3 的回复:int i = 10; 0041139E  mov         dword ptr [i],0Ah   	printf("i = %d\n",i); 004113A5  mov         esi,esp   004113A7  mov         eax,dword ptr [i]   004113AA  push        eax   004113AB  push        offset string "i = %d\n" (415764h)   004113B0  call        dword ptr [__imp__printf (4182B0h)]   004113B6  add         esp,8   004113B9  cmp         esi,esp   004113BB  call        @ILT+305(__RTC_CheckEsp) (411136h)   	printf("i++ = %d\n",i++); 004113C0  mov         eax,dword ptr [i]   004113C3  mov         dword ptr [ebp-0D0h],eax   004113C9  mov         ecx,dword ptr [i]   004113CC  add         ecx,1   004113CF  mov         dword ptr [i],ecx   004113D2  mov         esi,esp   004113D4  mov         edx,dword ptr [ebp-0D0h]   004113DA  push        edx   004113DB  push        offset string "i++ = %d\n" (415758h)   004113E0  call        dword ptr [__imp__printf (4182B0h)]   004113E6  add         esp,8   004113E9  cmp         esi,esp   004113EB  call        @ILT+305(__RTC_CheckEsp) (411136h)   	printf("i++ = %d\n",i++); 004113F0  mov         eax,dword ptr [i]   004113F3  mov         dword ptr [ebp-0D0h],eax   004113F9  mov         ecx,dword ptr [i]   004113FC  add         ecx,1   004113FF  mov         dword ptr [i],ecx   00411402  mov         esi,esp   00411404  mov         edx,dword ptr [ebp-0D0h]   0041140A  push        edx   0041140B  push        offset string "i++ = %d\n" (415758h)   00411410  call        dword ptr [__imp__printf (4182B0h)]   00411416  add         esp,8   00411419  cmp         esi,esp   0041141B  call        @ILT+305(__RTC_CheckEsp) (411136h)    	i=100; 00411420  mov         dword ptr [i],64h   	printf("i,i++,i++ = %d,%d,%d\n",i,i++,i++); 00411427  mov         eax,dword ptr [i]   0041142A  mov         dword ptr [ebp-0D0h],eax   00411430  mov         ecx,dword ptr [i]   00411433  add         ecx,1   00411436  mov         dword ptr [i],ecx   00411439  mov         edx,dword ptr [i]   0041143C  mov         dword ptr [ebp-0D4h],edx   00411442  mov         eax,dword ptr [i]   00411445  add         eax,1   00411448  mov         dword ptr [i],eax   0041144B  mov         esi,esp   0041144D  mov         ecx,dword ptr [ebp-0D0h]   00411453  push        ecx   00411454  mov         edx,dword ptr [ebp-0D4h]   0041145A  push        edx   0041145B  mov         eax,dword ptr [i]   0041145E  push        eax   0041145F  push        offset string "i,i++,i++ = %d,%d,%d\n" (41573Ch)   00411464  call        dword ptr [__imp__printf (4182B0h)]   0041146A  add         esp,10h   0041146D  cmp         esi,esp   0041146F  call        @ILT+305(__RTC_CheckEsp) (411136h) 有毛病

user: user-0
content: 引用 4 楼 lin5161678 的回复:[quote=引用 2 楼 xxxxing 的回复:]  不运行 就说 是错了  能说什么 不要以为 能运行就是对的好不好  让你去看置顶帖你看来没有  [/quote] 正在看

user: user-2
content: 引用 2 楼 xxxxing 的回复:不运行 就说 是错了  能说什么 不要以为 能运行就是对的好不好  让你去看置顶帖你看来没有

user: user-3
content: int i = 10; 0041139E  mov         dword ptr [i],0Ah   	printf("i = %d\n",i); 004113A5  mov         esi,esp   004113A7  mov         eax,dword ptr [i]   004113AA  push        eax   004113AB  push        offset string "i = %d\n" (415764h)   004113B0  call        dword ptr [__imp__printf (4182B0h)]   004113B6  add         esp,8   004113B9  cmp         esi,esp   004113BB  call        @ILT+305(__RTC_CheckEsp) (411136h)   	printf("i++ = %d\n",i++); 004113C0  mov         eax,dword ptr [i]   004113C3  mov         dword ptr [ebp-0D0h],eax   004113C9  mov         ecx,dword ptr [i]   004113CC  add         ecx,1   004113CF  mov         dword ptr [i],ecx   004113D2  mov         esi,esp   004113D4  mov         edx,dword ptr [ebp-0D0h]   004113DA  push        edx   004113DB  push        offset string "i++ = %d\n" (415758h)   004113E0  call        dword ptr [__imp__printf (4182B0h)]   004113E6  add         esp,8   004113E9  cmp         esi,esp   004113EB  call        @ILT+305(__RTC_CheckEsp) (411136h)   	printf("i++ = %d\n",i++); 004113F0  mov         eax,dword ptr [i]   004113F3  mov         dword ptr [ebp-0D0h],eax   004113F9  mov         ecx,dword ptr [i]   004113FC  add         ecx,1   004113FF  mov         dword ptr [i],ecx   00411402  mov         esi,esp   00411404  mov         edx,dword ptr [ebp-0D0h]   0041140A  push        edx   0041140B  push        offset string "i++ = %d\n" (415758h)   00411410  call        dword ptr [__imp__printf (4182B0h)]   00411416  add         esp,8   00411419  cmp         esi,esp   0041141B  call        @ILT+305(__RTC_CheckEsp) (411136h)    	i=100; 00411420  mov         dword ptr [i],64h   	printf("i,i++,i++ = %d,%d,%d\n",i,i++,i++); 00411427  mov         eax,dword ptr [i]   0041142A  mov         dword ptr [ebp-0D0h],eax   00411430  mov         ecx,dword ptr [i]   00411433  add         ecx,1   00411436  mov         dword ptr [i],ecx   00411439  mov         edx,dword ptr [i]   0041143C  mov         dword ptr [ebp-0D4h],edx   00411442  mov         eax,dword ptr [i]   00411445  add         eax,1   00411448  mov         dword ptr [i],eax   0041144B  mov         esi,esp   0041144D  mov         ecx,dword ptr [ebp-0D0h]   00411453  push        ecx   00411454  mov         edx,dword ptr [ebp-0D4h]   0041145A  push        edx   0041145B  mov         eax,dword ptr [i]   0041145E  push        eax   0041145F  push        offset string "i,i++,i++ = %d,%d,%d\n" (41573Ch)   00411464  call        dword ptr [__imp__printf (4182B0h)]   0041146A  add         esp,10h   0041146D  cmp         esi,esp   0041146F  call        @ILT+305(__RTC_CheckEsp) (411136h)

user: user-0
content: 引用 1 楼 lin5161678 的回复:printf("i,i++,i++ = %d,%d,%d\n",i,i++,i++); 代码是错的 结果没意义  基于结果得到的结论也没意义  怎么错的 看置顶帖  不运行 就说 是错了  能说什么

user: user-2
content: printf("i,i++,i++ = %d,%d,%d\n",i,i++,i++); 代码是错的 结果没意义  基于结果得到的结论也没意义  怎么错的 看置顶帖