How to avoid multiplication in pointer arithmetic?
问题 If I write int main(int argc, char *argv[]) { int temp[50][3]; return &temp[argc] - &temp[0]; } and compile it with Visual C++, I get back: 009360D0 55 push ebp 009360D1 8B EC mov ebp,esp 009360D3 8B 45 08 mov eax,dword ptr [argc] 009360D6 8D 0C 40 lea ecx,[eax+eax*2] 009360D9 B8 AB AA AA 2A mov eax,2AAAAAABh 009360DE C1 E1 02 shl ecx,2 009360E1 F7 E9 imul ecx 009360E3 D1 FA sar edx,1 009360E5 8B C2 mov eax,edx 009360E7 C1 E8 1F shr eax,1Fh 009360EA 03 C2 add eax,edx 009360EC 5D pop ebp