![]() ![]() |
|
灵活使用GOTO语句 | |
作者:佚名 文章来源:不详 点击数 更新时间:2008/4/18 14:38:31 文章录入:杜斌 责任编辑:杜斌 | |
|
|
#include <string> #include <iostream> using namespace std; class B{ public: B(){ cout << "BBBBBBBBBBBB" <<endl; }; ~B(){ cout << "SHB" << endl; }; protected: private: }; int func(...){ cout << "EN"; return 0; }; int main (int argv,char* argc[]){ char * str_1 = "HelloTEST"; char str_2[200] ; func(1,"ABC",false); memset(str_2,’F’,200); strcpy(str_2,str_1); const int ** p; int * const *q; while(1) { B b; //goto HEIHEI; 屏蔽掉goto 和开启goto 看看 B的析构函数是怎么跑的,能正确析构吗?goto都干了什么。 } HEIHEI: int ABC = 0; return 0; } |
|
![]() ![]() |