锘??xml version="1.0" encoding="utf-8" standalone="yes"?>99久久精品国产高清一区二区,久久99精品国产麻豆蜜芽,久久人人爽人人爽人人爽 http://www.shnenglu.com/Lenus/category/6081.html鎴愰暱涓殑鍒嗘瀽鍛橈紝璁板綍瀹為獙浜虹敓 zh-cn Wed, 28 Apr 2010 20:16:05 GMT Wed, 28 Apr 2010 20:16:05 GMT 60 鍏充簬铏氭瀽鏋勫嚱鏁?/title> http://www.shnenglu.com/Lenus/articles/51678.htmlmargin margin Sat, 31 May 2008 04:32:00 GMT http://www.shnenglu.com/Lenus/articles/51678.html http://www.shnenglu.com/Lenus/comments/51678.html http://www.shnenglu.com/Lenus/articles/51678.html#Feedback 0 http://www.shnenglu.com/Lenus/comments/commentRss/51678.html http://www.shnenglu.com/Lenus/services/trackbacks/51678.html
#include < iostream > using namespace std; class CBase { public : CBase() { cout << " I in Base constructor " << endl; } virtual ~ CBase() { cout << " I in Base deconstructor " << endl; } }; class CDerived : public CBase { public : CDerived() { cout << " I in CDerived constructor " << endl; } virtual ~ CDerived() { cout << " I in CDerived deconstructor " << endl; } }; int main() { CBase * pBase = new CDerived(); delete pBase; return 0 ; }
杈撳嚭緇撴灉 I in Base constructor I in CDerived constructor I in CDerived deconstructor I in Base deconstructor 浠ュ墠涓鐩磋寰梫irtual鐨勬寚瀹氭槸鍙湁鍙棤鐨勶紝鐜板湪鎵嶇煡閬擄紝濡傛灉涓嶅埗瀹歷irutal錛岄偅涔圛 in CDerived deconstructor灝變笉浼氳皟鐢ㄣ傝繖涓笌construtor瀹屽叏涓嶄竴鏍鳳紝浜嬪疄涓婁篃姝f槸榪欐牱鎶婁粬/瀹冨拷鐣ヤ簡銆?br> 鎺ョ潃灝辮鎯蟲兂濡備綍瀹炵幇鐨勫憿錛?br> 鍏堟潵鐪嬬湅鏋勯犲嚱鏁?br>004012CF . 894D F0 mov [ebp-10], ecx 004012D2 . 8B4D F0 mov ecx, [ebp-10] 004012D5 . E8 D0FDFFFF call 004010AA ; 璋冪敤鍩虹被鐨勬瀯閫犲嚱鏁?br>004012DA . C745 FC 00000>mov dword ptr [ebp-4], 0 004012E1 . 8B45 F0 mov eax, [ebp-10] 004012E4 . C700 3C204300 mov dword ptr [eax], offset CDerived::`vftable' 004012EA . 68 2D104000 push 0040102D 004012EF . 68 1C204300 push 0043201C ; ASCII "I in CDerived constructor" 004012F4 . 68 40954300 push offset std::cout 004012F9 . E8 CAFDFFFF call 004010C8 鍜屼互鍓嶇悊瑙g殑涓鏍鳳紝涓嶅瑙i噴 涓嬮潰鏄瀽鏋勫嚱鏁?娉ㄦ剰榪欓噷鏄疌Derived鐢熸垚鐨刣elete鍑芥暟鍝? 00401069 . /E9 32040000 jmp CDerived::`scalar deleting destructor' 004014BA |. 894D FC mov [ebp-4], ecx 004014BD |. 8B4D FC mov ecx, [ebp-4] 004014C0 |. E8 F9FBFFFF call 004010BE ; 璋冪敤瀛愮被鐨勬瀽鏋勫嚱鏁?br>004014C5 |. 8B45 08 mov eax, [ebp+8] 004014C8 |. 83E0 01 and eax, 1 004014CB |. 85C0 test eax, eax 004014CD |. 74 0C je short 004014DB 004014CF |. 8B4D FC mov ecx, [ebp-4] 004014D2 |. 51 push ecx ; /Arg1 004014D3 |. E8 A8130000 call operator delete ; \operator delete 0040153F . 894D F0 mov [ebp-10], ecx 00401542 . 8B45 F0 mov eax, [ebp-10] 00401545 . C700 3C204300 mov dword ptr [eax], offset CDerived::`vftable' 0040154B . C745 FC 00000>mov dword ptr [ebp-4], 0 00401552 . 68 2D104000 push 0040102D 00401557 . 68 80204300 push 00432080 ; ASCII "I in CDerived disconstructor" 0040155C . 68 40954300 push offset std::cout 00401561 . E8 62FBFFFF call 004010C8 00401566 . 83C4 08 add esp, 8 00401569 . 8BC8 mov ecx, eax 0040156B . E8 1CFBFFFF call 0040108C 00401570 . C745 FC FFFFF>mov dword ptr [ebp-4], -1 00401577 . 8B4D F0 mov ecx, [ebp-10] 0040157A . E8 E0FAFFFF call 0040105F ; 鍩虹被鐨勬瀽鏋勫嚱鏁?/p>
緇撹錛?br>緙栬瘧鍣ㄤ笉鑳借嚜鍔ㄨ瘑鍒瀽鏋勫嚱鏁幫紝蹇呴』瑕佸鎬佺殑鏍囪瘑銆?/p>
]]> pku acm 1002 http://www.shnenglu.com/Lenus/articles/47350.htmlmargin margin Wed, 16 Apr 2008 18:25:00 GMT http://www.shnenglu.com/Lenus/articles/47350.html http://www.shnenglu.com/Lenus/comments/47350.html http://www.shnenglu.com/Lenus/articles/47350.html#Feedback 0 http://www.shnenglu.com/Lenus/comments/commentRss/47350.html http://www.shnenglu.com/Lenus/services/trackbacks/47350.html 闃呰鍏ㄦ枃 ]]> pku acm 1007 http://www.shnenglu.com/Lenus/articles/47160.htmlmargin margin Tue, 15 Apr 2008 14:35:00 GMT http://www.shnenglu.com/Lenus/articles/47160.html http://www.shnenglu.com/Lenus/comments/47160.html http://www.shnenglu.com/Lenus/articles/47160.html#Feedback 0 http://www.shnenglu.com/Lenus/comments/commentRss/47160.html http://www.shnenglu.com/Lenus/services/trackbacks/47160.html problem : http://acm.pku.edu.cn/JudgeOnline/problem?id=1007 reference : http://blog.csdn.net/china8848/archive/2008/03/29/2227131.aspx source :
#include < stdio.h > #include < memory.h > #include < stdlib.h > int n,m; char DNA[ 100 ][ 100 ] = { 0 } ; int calc_unsortedness( const char * pDNA, int length) { int i; char a; int left_C = 0 , left_G = 0 , left_T = 0 ; int count = 0 ; for (i = length - 1 ; i >= 0 ; i -- ) { a = pDNA[i]; switch (a) { case ' A ' : left_C ++ ; left_G ++ ; left_T ++ ; break ; case ' C ' : left_G ++ ; left_T ++ ; count += left_C; break ; case ' G ' : left_T ++ ; count += left_G; break ; case ' T ' : count += left_T; break ; } } return count; } int compare( const void * arg1, const void * arg2) { return calc_unsortedness(( const char * )arg1, n) - calc_unsortedness(( const char * )arg2, n); } int main() { int i; scanf( " %d %d\n " , & n, & m); // memset(DNA, 0, sizeof(DNA)); for (i = 0 ; i < m; ++ i) gets(DNA[i]); qsort(( void * )DNA, m, sizeof ( char ) * 100 , compare); for (i = 0 ; i < m; ++ i) puts(DNA[i]); return 0 ; }
濂戒箙娌″仛棰樹簡錛屼粖澶╁洖鏉ュ緱鏃┿傚氨鎶婂墠鍑犲ぉ鐪嬩簡鐨勮繖棰樼粰瀹炵幇浜嗐侫C鐨勫巻紼嬪緢濂囨?br> 棣栧厛鏄痠nclude浜?lt;search.h> 錛岀粨鏋? CE 鎺ョ潃鏄悶閿欎簡n鍜宮錛屾妸DNA瀹氫箟涓?char DNA[50][100] 緇撴灉 : RTE 鐒跺悗灝嗕粬浠掍簡榪囨潵,灝卞彉鎴愪簡OLE 鐧炬濅笉寰楀叾瑙o紝鏈鍚庡畾涔塩har DNA[100][100]錛屽氨AC浜?
]]>C++紼嬪簭閫嗗悜(3)澶氶噸緇ф壙鍜岃櫄緇ф壙 http://www.shnenglu.com/Lenus/articles/45220.htmlmargin margin Sun, 23 Mar 2008 16:04:00 GMT http://www.shnenglu.com/Lenus/articles/45220.html http://www.shnenglu.com/Lenus/comments/45220.html http://www.shnenglu.com/Lenus/articles/45220.html#Feedback 0 http://www.shnenglu.com/Lenus/comments/commentRss/45220.html http://www.shnenglu.com/Lenus/services/trackbacks/45220.html
#include " iostream " using namespace std; class A { int a; public : virtual void Fun( int n) { a = n; cout << " This is in A : " << a << endl; } }; class B : public A { int b; public : virtual void Fun( int n) { b = n; cout << " This is in B : " << b << endl; } }; class C : public A { int c; public : virtual void Fun( int n) { c = n; cout << " This is in C : " << c << endl; } }; class D : public B, public C { int d; public : virtual void Fun( int n) { d = n; cout << " This is in D : " << d << endl; } }; int main() { D d; d.Fun( 3 ); return 0 ; }
鍏堟潵鐪嬬湅澶氶噸緇ф壙鐨勫璞$粍緇囩殑緇撴瀯 瀹為檯涓婏紝澶氶噸緇ф壙vc閮藉皢瀹冭В閲婁負榪欎釜緇撴瀯銆備絾鏄閲嶉泦鎴愪腑瀹為檯鍦ㄥ唴瀛樹腑鐨勭粍緇囨槸寰堜笉涓鏍風殑 00B606D8 0046F020 offset test3.D::`vftable' 00B606DC CDCDCDCD A::a 00B606E0 CDCDCDCD B::b 00B606E4 0046F01C offset test3.D::`vftable' 00B606E8 CDCDCDCD A::a 00B606EC CDCDCDCD C::c 00B606F0 CDCDCDCD D::d
note: 鎸夌収閬撶悊鏉ヨ涓や釜offset test3.D::`vftable'搴旇鎸囧悜鍚屼竴涓湴鏂規墠瀵癸紝鍙繖閲屾槸錛?br> 絎簩涓猳ffset test3.D::`vftable'鎸囧悜鐨勪綅緗槸絎簩綃囪榪囩殑璺寵漿鍑芥暟錛?br> 2.铏氱戶鎵?br>
#include " iostream " using namespace std; class A { int a; public : virtual void Fun( int n) { a = n; cout << " This is in A : " << a << endl; } }; class B : virtual public A { int b; public : virtual void Fun( int n) { b = n; cout << " This is in B : " << b << endl; } }; class C : virtual public A { int c; public : virtual void Fun( int n) { c = n; cout << " This is in C : " << c << endl; } }; class D : public B, public C { int d; public : virtual void Fun( int n) { d = n; cout << " This is in D : " << d << endl; } }; int main() { D * pd = new D; pd -> Fun( sizeof (D)); return 0 ; }
00A806D8 0046F02C offset test3.D::`vbtable' 00A806DC CDCDCDCD B::b 00A806E0 0046F020 offset test3.D::`vbtable' 00A806E4 CDCDCDCD C::c 00A806E8 CDCDCDCD A::a 00A806EC 0046F01C offset test3.D::`vftable' 00A806F0 CDCDCDCD D::d 絎竴鍜岀浜屼釜offset test3.D::`vbtable' 鎸囧悜涓涓亸縐昏煩杞〃錛屽畠鐨勮〃涓敤鍋忕Щ鎸囧悜浜嗙湡姝g殑offset test3.D::`vbtable'錛岀涓変釜鏄湡姝g殑offset test3.D::`vbtable'鍦板潃 0046F01C >004011A9 test3.004011A9 絎笁涓猳ffset test3.D::`vbtable' 0046F020 >00000000 絎簩涓猳ffset test3.D::`vbtable' 0046F024 0000000C 鍋忕ЩC 0046F028 00000000 0046F02C >00000000 絎竴涓猳ffset test3.D::`vbtable' 0046F030 00000014 渚垮疁14
]]>C++紼嬪簭閫嗗悜(3) http://www.shnenglu.com/Lenus/articles/43978.htmlmargin margin Sat, 08 Mar 2008 10:12:00 GMT http://www.shnenglu.com/Lenus/articles/43978.html http://www.shnenglu.com/Lenus/comments/43978.html http://www.shnenglu.com/Lenus/articles/43978.html#Feedback 0 http://www.shnenglu.com/Lenus/comments/commentRss/43978.html http://www.shnenglu.com/Lenus/services/trackbacks/43978.html 1.浠g爜
#include < iostream > using namespace std; class A { public : virtual void fun1() { cout << " A::fun1 " << endl;} virtual void fun2() {cout << " A::fun2 " << endl;} }; class B : public A { public : virtual void fun1() { cout << " B::fun1 " << endl;} virtual void fun2() {cout << " B::fun2 " << endl;} }; void main() { void (A:: * f1)(); void (A:: * f2)(); A * p = new B; f1 = & A::fun1; f2 = & A::fun2; (p ->* f1)(); (p ->* f2)(); printf( " f1 = %p f2 = %p\n " , f1, f2); printf( " B::fun1 = %p, B::fun2 = %p\n " , & A::fun1, & A::fun2); delete p; system( " pause " ); }
2.緇撴灉 B::fun1 B::fun2 f1 = 004010AA f2 = 004010B4 B::fun1 = 004010AA, B::fun2 = 004010B4 3.瑙f儜 i. 濡傛灉瀵逛簬涓轟粈涔坒 = A::funx 鍗磋緭鍑虹殑鏄疊::funx錛?br> ii. 涓轟粈涔圓::funx = B::funx 浠ヤ笂涓や釜闂鍙互褰撲綔鏄竴涓紝鐪嬬湅姹囩紪灝辯煡閬撲簡錛屼粬浠皢鐢熸垚涓涓櫄鍑芥暟鐨勯夋嫨鍑芥暟錛岀煭灝忕殑鍑芥暟璐熻矗閫夊搴旇櫄鍑芥暟涓殑浣嶇疆錛屾牴鎹璞$殑铏氬嚱鏁拌〃鑰屽畾錛屾墍浠?... 4.姹囩紪 debug
0040121E . C745 F0 AA104 > mov dword ptr [ebp - 10 ], 004010AA 00401225 . C745 EC B4104 > mov dword ptr [ebp - 14 ], 004010B4 0040122C . 8BF4 mov esi, esp 0040122E . 8B4D E8 mov ecx, [ebp - 18 ] 00401231 . FF55 F0 call [ebp - 10 ] 00401234 . 3BF4 cmp esi, esp 00401236 . E8 A5870000 call _chkesp 0040123B . 8BF4 mov esi, esp 0040123D . 8B4D E8 mov ecx, [ebp - 18 ] 00401240 . FF55 EC call [ebp - 14 ] 00401243 . 3BF4 cmp esi, esp 00401245 . E8 96870000 call _chkesp 0040124A . 8B55 EC mov edx, [ebp - 14 ] 0040124D . 52 push edx ; /<%p> 0040124E . 8B45 F0 mov eax, [ebp-10] ; | 00401251 . 50 push eax ; |<%p> 00401252 . 68 48404300 push 00434048 ; |format = "f1 = %p f2 = %p",LF,"" 00401257 . E8 14820000 call printf ; \printf 0040125C . 83C4 0C add esp, 0C 0040125F . 68 B4104000 push 004010B4 ; /<%p> = Cplusplu.004010B4 00401264 . 68 AA104000 push 004010AA ; |<%p> = Cplusplu.004010AA 00401269 . 68 24404300 push 00434024 ; |format = "B::fun1 = %p, B::fun2 = %p",LF,"" 0040126E . E8 FD810000 call printf ; \printf 00402300 > > \8B01 mov eax, [ecx] // 絎竴涓櫄鍑芥暟 00402302 . FF20 jmp [eax] 00402304 CC int3 00402305 CC int3 00402306 CC int3 00402307 CC int3 00402308 CC int3 00402309 CC int3 0040230A CC int3 0040230B CC int3 0040230C CC int3 0040230D CC int3 0040230E CC int3 0040230F CC int3 00402310 > > 8B01 mov eax, [ecx] // 絎簩涓櫄姹楁暟 00402312 . FF60 04 jmp [eax+4]
release
]]> C++閫嗗悜紼嬪簭(2) http://www.shnenglu.com/Lenus/articles/43575.htmlmargin margin Sun, 02 Mar 2008 14:12:00 GMT http://www.shnenglu.com/Lenus/articles/43575.html http://www.shnenglu.com/Lenus/comments/43575.html http://www.shnenglu.com/Lenus/articles/43575.html#Feedback 3 http://www.shnenglu.com/Lenus/comments/commentRss/43575.html http://www.shnenglu.com/Lenus/services/trackbacks/43575.html 鍦ㄦ潵鐪嬬湅C++鐨勮櫄鍑芥暟鍜岀戶鎵?br> 1.C++浠g爜
#include " iostream " using namespace std; class C { public : int c; virtual void display( int s); } ; void C::display( int s) { c = 3 ; cout << " this is in C: " << s << " " << c << endl; } class D : public C { public : int d; void display( int s); } ; void D::display( int s) { d = 4 ; cout << " this is in d: " << s << " " << d << endl; } void main() { C c; c.display( sizeof (c)); C * d = (C * ) new D; d -> display( sizeof (d)); }
2.姹囩紪浠g爜 1.debug緙栬瘧
.text:00401830 main proc near ; CODE XREF: _mainj .text:00401830 .text:00401830 var_54 = dword ptr -54h .text:00401830 var_14 = dword ptr -14h .text:00401830 var_8 = dword ptr -8 .text:00401830 .text:00401830 push ebp .text:00401831 mov ebp, esp .text:00401833 sub esp, 54h .text:00401836 push ebx .text:00401837 push esi .text:00401838 push edi .text:00401839 lea edi, [ebp+var_54] .text:0040183C mov ecx, 15h .text:00401841 mov eax, 0CCCCCCCCh .text:00401846 rep stosd .text:00401848 lea ecx, [ebp+var_8] .text:0040184B call j_C__C .text:00401850 push 8 .text:00401852 lea ecx, [ebp+var_8] .text:00401855 call j_C__display .text:0040185A lea ecx, [ebp+var_14] .text:0040185D call j_D__D .text:00401862 push 0Ch .text:00401864 lea ecx, [ebp+var_14] .text:00401867 call j_D__display .text:0040186C pop edi .text:0040186D pop esi .text:0040186E pop ebx .text:0040186F add esp, 54h .text:00401872 cmp ebp, esp .text:00401874 call __chkesp .text:00401879 mov esp, ebp .text:0040187B pop ebp .text:0040187C retn .text:0040187C main endp
鍦╟all鐪熸鐨勫嚱鏁頒箣鍓嶆湁涓涓猚all j_C__C錛岀湅鐪嬪畠鐨勪唬鐮?br>
.text: 00401890 ; Attributes: bp - based frame .text: 00401890 .text:00401890 C__C proc near ; CODE XREF: j_C__Cj .text: 00401890 .text:00401890 var_44 = dword ptr - 44h .text: 00401890 var_4 = dword ptr - 4 .text:00401890 .text:00401890 push ebp .text: 00401891 mov ebp, esp .text: 00401893 sub esp, 44h .text: 00401896 push ebx .text: 00401897 push esi .text: 00401898 push edi .text: 00401899 push ecx .text:0040189A lea edi, [ebp + var_44] .text:0040189D mov ecx, 11h .text:004018A2 mov eax, 0CCCCCCCCh .text:004018A7 rep stosd .text:004018A9 pop ecx .text:004018AA mov [ebp + var_4], ecx .text:004018AD mov eax, [ebp + var_4] .text:004018B0 mov dword ptr [eax], offset ?? _7C@@6B@ ; const C::`vftable ' .text:004018B6 mov eax, [ebp + var_4] .text:004018B9 pop edi .text:004018BA pop esi .text:004018BB pop ebx .text:004018BC mov esp, ebp .text:004018BE pop ebp .text:004018BF retn .text:004018BF C__C endp
鍘熸潵鏄幏鍙栵紝铏氬嚱鏁拌〃鐨?*^__^*)...鍢誨樆 2.release緙栬瘧
.text:00401140 ; int __cdecl main(int argc,const char **argv,const char *envp) .text:00401140 _main proc near ; CODE XREF: start+AFp .text:00401140 .text:00401140 var_14 = dword ptr -14h .text:00401140 var_C = dword ptr -0Ch .text:00401140 argc = dword ptr 4 .text:00401140 argv = dword ptr 8 .text:00401140 envp = dword ptr 0Ch .text:00401140 .text:00401140 sub esp, 14h .text:00401143 push 8 .text:00401145 lea ecx, [esp+18h+var_14] .text:00401149 mov [esp+18h+var_14], offset off_4120EC .text:00401151 call sub_401000 .text:00401156 push 0Ch .text:00401158 lea ecx, [esp+18h+var_C] .text:0040115C mov [esp+18h+var_C], offset off_4120E8 .text:00401164 call sub_4010A0 .text:00401169 add esp, 14h .text:0040116C retn .text:0040116C _main endp
release灝辯洿鎺ユ妸铏氬嚱鏁拌〃緇欒В閲婂嚭鏉ヤ簡 3.杈撳嚭緇撴灉 this is in C:8 3 this is in d:12 4 4.緇撹 1.铏氬熀綾婚櫎浜嗗彉閲忚繕鏈?瀛楄妭鐨剉ftable(鍦ㄥ彉閲忓墠闈? 2.debug瑕佺敤鍑芥暟瑙i噴vftable錛宺elease鐩存帴緇欏嚭 3.緇忓父璇寸殑鎵璋撹櫄鍑芥暟琚鐩栬繃紼嬶紝鍙互鐪嬬湅class D瑙i噴vftable浠g爜
.text:004018E9 pop ecx .text:004018EA mov [ebp + var_4], ecx .text:004018ED mov ecx, [ebp + var_4] .text:004018F0 call j_C__C //鍒濆鍖栫埗綾?br> .text:004018F5 mov eax, [ebp + var_4] .text:004018F8 mov dword ptr [eax], offset ?? _7D@@6B@ ; const D::`vftable ' .text:004018FE mov eax, [ebp + var_4] // 灝嗗啓鑷繁鐨勮〃
浠庤屽彲瑙侊紝VC鐨勭紪璇戝櫒鍦ㄧ紪璇戠殑鏃跺欙紝娌℃湁瑕嗙洊鐨勬蹇碉紝鍙槸緙栬瘧鐨勬椂鍊欐牴鎹湁闇瑕佺殑灝嗚櫄鍑芥暟琛ㄧ敓鎴愪笉鍚岀殑鍑犱釜鑰屽凡銆傛槸鍝釜灝辯敤鍝釜琛ㄣ?br> note: 铏界劧new鍑烘潵鐨勬槸涓涓瓙綾誨璞★紝浣嗘槸鐢變簬瀹冧粯緇欎簡涓涓埗綾葷殑綾誨瀷錛屾墍浠ュ彧鑳藉紩鐢ㄧ埗綾葷殑鎴愬憳銆傝繖灝卞嚭鐜頒簡涓涓鎬殑鐜拌薄錛屽湪緇ф壙鐨勬椂鍊欏凡緇忓皢鐖剁被鐨勬垚鍛樼戶鎵垮埌浜嗗瓙綾葷殑瀵硅薄閲岄潰錛岃岀敤vc鏌ョ湅鐨勬椂鍊欎細鍙戠幇榪欎竴鐐癸紝濂囨殑鏄敱浜庝笂闈㈢殑鍘熷洜浠栧皢鎶婂瓙綾葷殑鎴愬憳蹇界暐鎺夈傚嵆鍦ㄦ湰鏉ュ簲璇ユ槸瀛愮被鎴愬憳鐨勫湴鏂癸紝榪樻槸鐖剁被鎴愬憳鐨勫悕縐般傝櫧鐒舵煡鐪嬪唴瀛橈紝宸茬粡鍙戠幇瀛愮被鐨勬垚鍛樼‘瀹炲瓨鍦ㄣ傝屾垜浠彲浠ユ妸榪欎釜鐪嬩綔鏄被鍨嬭娌℃湁warning鐨勭緝灝忎簡錛?br>
]]> C++紼嬪簭閫嗗悜(1) http://www.shnenglu.com/Lenus/articles/43571.htmlmargin margin Sun, 02 Mar 2008 13:16:00 GMT http://www.shnenglu.com/Lenus/articles/43571.html http://www.shnenglu.com/Lenus/comments/43571.html http://www.shnenglu.com/Lenus/articles/43571.html#Feedback 0 http://www.shnenglu.com/Lenus/comments/commentRss/43571.html http://www.shnenglu.com/Lenus/services/trackbacks/43571.html C++鐨刢lass鐢盋鐨剆rtuct鍙樺寲鑰屾潵錛屽厛鏉ョ湅鐪嬩袱涓湴鏂規湁浠涔堝尯鍒? 1.C++浠g爜
1 #include " iostream " 2 using namespace std; 3 4 struct A 5 { 6 int a; 7 void display( int s); 8 }; 9 10 void A::display( int s) 11 { 12 a = 1 ; 13 cout<< " this is in A: " << s << " " << a << endl; 14 }15 16 class B 17 { 18 public : 19 int b; 20 void display( int s); 21 }; 22 23 void B::display( int s) 24 { 25 b = 2 ; 26 cout<< " this is in B: " << s << " " << b << endl; 27 }28 29 void main() 30 { 31 A a;32 a.display(sizeof(a));33 34 B b;35 b.display(sizeof(b));36 }37
2.姹囩紪浠g爜錛?br> 1.debug緙栬瘧
1 .text: 00401820 main proc near ; CODE XREF: _mainj 2 .text:00401820 3 .text:00401820 var_48 = dword ptr - 48h 4 .text:00401820 var_8 = dword ptr - 8 5 .text:00401820 var_4 = dword ptr - 4 6 .text:00401820 7 .text:00401820 push ebp 8 .text:00401821 mov ebp, esp 9 .text:00401823 sub esp, 48h 10 .text:00401826 push ebx 11 .text:00401827 push esi 12 .text:00401828 push edi 13 .text:00401829 lea edi, [ebp + var_48] 14 .text:0040182C mov ecx, 12h15 .text:00401831 mov eax, 0CCCCCCCCh 16 .text:00401836 rep stosd 17 .text:00401838 push 4 18 .text:0040183A lea ecx, [ebp+ var_4] 19 .text:0040183D call j_A__display20 .text:00401842 push 4 21 .text:00401844 lea ecx, [ebp + var_8] 22 .text:00401847 call j_B__display 23 .text:0040184C pop edi24 .text:0040184D pop esi25 .text:0040184E pop ebx26 .text:0040184F add esp, 48h27 .text:00401852 cmp ebp, esp 28 .text:00401854 call __chkesp 29 .text:00401859 mov esp, ebp 30 .text:0040185B pop ebp31 .text:0040185C retn32 .text:0040185C main endp33
2.release緙栬瘧
.text: 00401140 ; int __cdecl main( int argc, const char ** argv, const char * envp) .text: 00401140 _main proc near ; CODE XREF: start + AFp .text: 00401140 .text:00401140 var_8 = dword ptr - 8 .text:00401140 var_4 = dword ptr - 4 .text:00401140 argc = dword ptr 4 .text:00401140 argv = dword ptr 8 .text:00401140 envp = dword ptr 0Ch .text: 00401140 .text:00401140 sub esp, 8 .text:00401143 lea ecx, [esp + 8 + var_8] .text: 00401147 push 4 .text:00401149 call sub_401000 .text:0040114E push 4 .text:00401150 lea ecx, [esp + 0Ch + var_4] .text: 00401154 call sub_4010A0 .text: 00401159 add esp, 8 .text:0040115C retn .text:0040115C _main endp
3.杈撳嚭緇撴灉 this is in A:4 1 this is in B:4 2 4.緇撹 1.struct鍜宑lass娌℃湁浠諱綍鍖哄埆錛屼粬浠湪浠g爜孌墊湁涓涓?妯℃澘" 2.瀵硅薄鍗犵敤鐨?涓瓧鑺傛槸int鐨勫ぇ灝?br> 3.鍑芥暟鍦ㄤ唬鐮佷腑瀹氫箟錛岀敱緙栬瘧鍣ㄥ喅瀹氳皟鐢ㄨ皝
]]>
国内精品久久久久久久亚洲 |
国内精品伊人久久久久妇 |
国产精品美女久久久免费 |
久久久婷婷五月亚洲97号色
|
国内精品久久久久影院免费 |
国产激情久久久久久熟女老人 |
久久久久久国产a免费观看不卡 |
久久免费精品视频 |
伊人久久免费视频 |
丰满少妇人妻久久久久久4 |
久久精品国产亚洲AV蜜臀色欲
|
久久久精品人妻一区二区三区四 |
国产一区二区三区久久 |
国产精品中文久久久久久久 |
国产午夜久久影院 |
亚洲AV日韩精品久久久久 |
亚洲综合精品香蕉久久网 |
99国内精品久久久久久久 |
色偷偷久久一区二区三区 |
99精品久久久久中文字幕 |
国产精品成人99久久久久
|
久久夜色精品国产噜噜噜亚洲AV |
久久AAAA片一区二区 |
久久电影网2021 |
久久久无码人妻精品无码 |
久久精品国产2020 |
一本大道久久香蕉成人网 |
国产69精品久久久久观看软件
|
国内精品久久久久久久涩爱 |
久久精品人人做人人爽97 |
一本色道久久99一综合 |
伊人久久五月天 |
精品久久久久久无码专区不卡 |
久久er国产精品免费观看2 |
精品少妇人妻av无码久久 |
亚洲伊人久久精品影院 |
2021国产精品午夜久久 |
久久精品综合网 |
久久精品国产乱子伦 |
伊人色综合久久天天人手人婷 |
亚洲另类欧美综合久久图片区 |