C++?Щ????????
???????????? ???????[ 2016/6/23 10:29:54 ] ??????????????????? C++
????????c++??????У????????java??????java???????????????c++???飬????????????c++?????????????????????£??????c++???????????????vc++6.0??
????????????????????
1 #include <iostream>
2 using namespace std;
3 class A
4 {
5 public:
6 A(){
7 cout<<"this a"<<endl;
8 }
9 ~A(){cout<<"a dead"<<endl;}
10 class B
11 {
12 public:
13 B(){cout<<"this b"<<endl;}
14 ~B(){cout<<"b dead"<<endl;}
15 };
16 B b;
17 };
18 class c:public A
19 {
20 };
21 int main(int argc?? char * argv[])
22 {
23 A a;
24 return 0;
25 }
??????????????????????c++????????????????vc++6.0??????
???????B??????????????????????????????
1 #include <iostream>
2 using namespace std;
3 class A
4 {
5 public:
6 A(){
7 cout<<"this a"<<endl;
8 }
9 void getA(){cout<<"i am getA()"<<endl;}
10 ~A(){cout<<"a dead"<<endl;}
11 class B
12 {
13 public:
14 B(){cout<<"this b"<<endl;}
15 ~B(){cout<<"b dead"<<endl;}
16 void getB(){cout<<"i am getB()"<<endl;}
17
18 };
19 B b;
20 };
21 int main(int argc?? char * argv[])
22 {
23 A a;
24 a.b.getB();
25 A::B b;
26 b.getB();
27 return 0;
28 }
???????????????getB()??????????????????????????????????????????????????B???б???????????????????????
1 #include <iostream>
2 using namespace std;
3 class A
4 {
5 public:
6 A(){
7 cout<<"this a"<<endl;
8 }
9 void getA(){cout<<"i am getA()"<<endl;}
10 ~A(){cout<<"a dead"<<endl;}
11 class B:public A
12 {
13 public:
14 B(){cout<<"this b"<<endl;}
15 ~B(){cout<<"b dead"<<endl;}
16 void getB(){cout<<"i am getB()"<<endl;}
17
18 };
19 B b;
20 };
21
22 int main(int argc?? char * argv[])
23 {
24 A a;
25 a.b.getB();
26 A::B b;
27 b.getD();
28 return 0;
29 }
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11