发布网友 发布时间:2024-10-23 20:48
共2个回答
热心网友 时间:2024-10-30 19:03
VC中printf的声明是int _cdecl printf (const char *format, ...)
_cdecl声明printf参数入栈方式是从右向左入栈
VC6在处理时也是按照从右向左的顺序计算三个表达式的,所以结果就是
++c为6
c+8为14
c+=c++为12
VC6生成的汇编是
mov dword ptr [ebp-4],5
mov eax,dword ptr [ebp-4]
add eax,1
mov dword ptr [ebp-4],eax
mov ecx,dword ptr [ebp-4]
push ecx
mov edx,dword ptr [ebp-4]
add edx,8
push edx
mov eax,dword ptr [ebp-4]
add eax,dword ptr [ebp-4]
mov dword ptr [ebp-4],eax
mov ecx,dword ptr [ebp-4]
mov dword ptr [ebp-8],ecx
mov edx,dword ptr [ebp-8]
push edx
push offset string "%d,%d,%d" (0043101c)
mov eax,dword ptr [ebp-4]
add eax,1
mov dword ptr [ebp-4],eax
call printf (00408190)
观察4个push之前的操作就能理解了
热心网友 时间:2024-10-30 19:04
应该是10 14 7