C/C++培训
达内IT学院
400-996-5531
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
class A
{
friend class B;
private :
A(){}
~A(){}
};
class B: virtual public A
{
public :
B()
{}
};
class C : public B
{
public :
C()
{}
};
|
1
2
3
4
5
6
7
8
|
class A final
{
public :
A(){}
};
class B : public A // 编译出错
{};
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
class A
{
public :
static A* Get_A( int x)
{
return new A(x);
}
static void Delete_A(A* a)
{
delete a;
}
private :
A( int a = 10)
:_a(a)
{}
private :
int _a;
};
int main()
{
A* pa = A::Get_A(9);
A* pb = A::Get_A(7);
return 0;
}
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
class A
{
public :
static A Get_A( int x)
{
return A(x);
}
private :
A( int a = 10)
:_a(a)
{}
private :
int _a;
};
int main()
{
A pa = A::Get_A(9);
A pb = A::Get_A(7);
return 0;
}
|
填写下面表单即可预约申请免费试听!怕钱不够?可就业挣钱后再付学费! 怕学不会?助教全程陪读,随时解惑!担心就业?一地学习,可全国推荐就业!
Copyright © 京ICP备08000853号-56 京公网安备 11010802029508号 达内时代科技集团有限公司 版权所有
Tedu.cn All Rights Reserved