64,676
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
using namespace std;
int main()
{
int const c1=4;
int const c2[4] = {2, 4, 6, 8};
*(int *)&c1 = 5;
*(int *)&c2[2] = 9;
cout<<c1+c2[2]<<endl;
return 0;
}
#include <iostream>
using namespace std;
int const c1=4;
int const c2[4] = {2, 4, 6, 8};
int main()
{
*(int *)&c1 = 5;
*(int *)&c2[2] = 9;
cout<<c1+c2[2]<<endl;
return 0;
}
*(int *)&c1 = 5;
004113FE mov dword ptr [c1 (4156FCh)],5
*(int *)&c2[2] = 9;
00411408 mov dword ptr [c2+8 (415708h)],9
cout<<c1+c2[2]<<endl;
00411412 mov esi,esp
00411414 mov eax,dword ptr [__imp_std::endl (4182A0h)]
00411419 push eax
0041141A mov ecx,dword ptr [c2+8 (415708h)]
00411420 add ecx,4
00411423 mov edi,esp
00411425 push ecx
00411426 mov ecx,dword ptr [__imp_std::cout (418294h)]
0041142C call dword ptr [__imp_std::basic_ostream<char,std::char_traits<char> >::operator<< (418298h)]
00411432 cmp edi,esp
00411434 call @ILT+315(__RTC_CheckEsp) (411140h)
00411439 mov ecx,eax
0041143B call dword ptr [__imp_std::basic_ostream<char,std::char_traits<char> >::operator<< (41829Ch)]