????6. ??????????
?????????t???????????????÷?????????????????????÷??????????????????????????????????????this??????C++?????????????????????????????????????????????????????????????????????????κ??????????????<class-name>::<member>????????????????????????this???
????????point::get_instances()??????????????

(gdb)disassemble/m_ZN5point13get_instancesEv
Dumpofassemblercodeforfunction_ZN5point13get_instancesEv:
17staticintget_instances()
0x08048530<_ZN5point13get_instancesEv+0>:pushebp
0x08048531<_ZN5point13get_instancesEv+1>:movebp??esp
18{
19returnins_cnt;
0x08048533<_ZN5point13get_instancesEv+3>:moveax??ds:0x804a01c
20}
0x08048538<_ZN5point13get_instancesEv+8>:popebp
0x08048539<_ZN5point13get_instancesEv+9>:ret
Endofassemblerdump.
????????????????д??????????κβ???????????????????ú???????д?????????????????????void????????????????ú???????????????????main?????????????????
????39              x.move(10?? 10);
????0x080484ba <main+38>:   mov    DWORD PTR [esp+0x8]??0xa
????0x080484c2 <main+46>:   mov    DWORD PTR [esp+0x4]??0xa
????0x080484ca <main+54>:   lea    eax??[esp+0x14]
????0x080484ce <main+58>:   mov    DWORD PTR [esp]??eax
????0x080484d1 <main+61>:   call   0x804853a <_ZN5point4moveEii>
????40
????41              int p_ins_cnt = point::get_instances();
????0x080484d6 <main+66>:   call   0x8048530 <_ZN5point13get_instancesEv>
????0x080484db <main+71>:   mov    DWORD PTR [esp+0x1c]??eax
??????x.move(10?? 10)????????????????????mov …?? 0xa??????10??????У????_ZN5point4moveEii???????????????????????????????this????
??????x.move(10?? 10) ?????????????call _ZN5point13get_instancesEv?????_ZN5point13get_instancesEv?????????κβ?????
???????point::get_instances()?????????C?????????????£?
????[cpp] view plaincopyprint?
????int point::get_instances(void)
????{
????return point_ins_cnt;
????}
????7. ???
??????????C++?麯??????е?????????C++??????????沼??????????????????????
????1??class??????????????????????????????棬???????????????????????嶨????????????
????2) class??????????????????????????????????е????????????????????????????????б?????g++??????????????????0????????????.bss????????.data??????
????3??????????????????????????棬????C++???????????????????????????????????????this??????????????????????????????????
????4) ??????????????????????????棬????C++???????????????????????????????this?????????????????????????????????
????8. ???????????
???????????????????????????C++??????????沼?????????????????????????У??????????????????????const?????????????????????????const??????????????????????????????const???????????????????????????????????????????????