上一页 1 ··· 18 19 20 21 22
摘要: 1 #include 2 using namespace std; 3 struct struct1{ 4 /* 5 struct1(){ 6 cout<<"this is output by struct1 !"; 7 } 8 if add this code block , such errors like 'you must initlizer data number of struct1 9 10 by constructor in g++98' will occor in compile time,11 */12 ... 阅读全文
posted @ 2014-04-12 12:41 Birding 阅读(2699) 评论(0) 推荐(0)
摘要: #include using namespace std;class class1 { public: class1(){ } class1(int i ){ } void show(){ coutshow(); return 0;} 总结一下:1. 当使用类的无参构造函数来实例化对象时,... 阅读全文
posted @ 2014-04-12 12:40 Birding 阅读(533) 评论(0) 推荐(0)
摘要: 1 #include 2 using namespace std; 3 struct struct1{ 4 int data1 ; 5 double data2 ; 6 struct1(){ 7 (*this).data1 = data1 ; 8 (*this).data2 = data2 ; 9 coutshowClass2();74 /* test struct inherit class */75 //struct4 onestruct4 ;76 //onestruct4.showCla... 阅读全文
posted @ 2014-04-11 23:53 Birding 阅读(988) 评论(1) 推荐(0)
上一页 1 ··· 18 19 20 21 22