C/C++????????????
???????????? ???????[ 2015/1/19 13:13:33 ] ????????Net ???????
????????????????????????????????????????????????????????????????(?????)?????У????ú?????????????Swap(nA?? nB)??Swap(&nA?? &nB);?????????????????????????????????????????????????????????ú??????Ч???????????????????????????????????????Ч????????????????????????????????????????????????????Ч????
?????????
??????????????????????????
????// Test to pass by value
????SetValue(nA);
????0041374A mov eax??dword ptr [ebp-8]
????0041374D push eax
????0041374E mov ecx??dword ptr [nA]
????00413751 push ecx
????00413752 call SetValue (4111EAh)
????00413757 add esp??8
???????????????32λ??CPU??????????????????64Bit??????????2??32Bit??????????С??????????????????????γ???????????????????????????????????к???????????????????????????彫????????????32Bit??????????????????????????????Ч????????????????????????????????????????????????????????????????????????const???Σ???(const MY_STRUCT& _value);
???????????????Test001????????????????????????
????__int64* _pArray = NULL;
????004137E0 mov dword ptr [_pArray]??0
????// Test the pointer
????GetMemory(_pArray);
????00413812 mov eax??dword ptr [_pArray]
????00413815 push eax
????00413816 call GetMemory (411203h)
????0041381B add esp??4
?????????????????????????????0?????????????????????GetMemory(_pArray)?????????£??????????????_pArray????GetMemory()?????????????е??????????????????????????????????????????????????????????й????????????C++ Primer???????????????????????????????????????????????????????????????????????????????????????????????????????????????(1??4BYTE???)??????????????????ε??????????????????????????????????????????
??????????????Test002????????????????????????
????__int64* _pArray = NULL;
????004137E0 mov dword ptr [_pArray]??0
????GetMemory(&_pArray);
????004137E7 lea eax??[_pArray]
????004137EA push eax
????004137EB call GetMemory (4111FEh)
????004137F0 add esp??4
????????????????lea eax??[_pArray] ?????????_pArray????????????????
??????????GetMemory(&_pArray)??????????
????0x0040159b <+0>: push ebp
????0x0040159c <+1>: mov ebp??esp
????0x0040159e <+3>: sub esp??0x18
????0x004015a1 <+6>: mov DWORD PTR [esp]??0x20
????0x004015a8 <+13>: call 0x473ef0 <_Znaj>
????0x004015ad <+18>: mov edx??DWORD PTR [ebp+0x8]
????0x004015b0 <+21>: mov DWORD PTR [edx]??eax
????0x004015b2 <+23>: leave
????0x004015b3 <+24>: ret
????????????????????????????????÷????亯??????????????????eax.
??????????????????ebp+0x8?????????????????е????_pArray????.
????mov DWORD PTR [edx]??eax????????????????eax??edx????????_pArray?????????eax.
?????????????????????????????????????????????????????????????????ú???????????????????????????????????????????????????????????????????????????????????ú??????Ч??????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11