- 76
- 0
- 约2.29千字
- 约 5页
- 2015-10-10 发布于河南
- 举报
艾默生笔试真题
艾默生-软件工程师笔试题
1.考察虚继承内存体系
class A
{
public:
A() { coutConstruct A
~A() { coutDestruct A
void speak() { coutA is speaking!
};
class B:public virtual A
{
public:
B() { coutConstruct B
~B() { coutDestruct B
};
class C:public virtual A
{
public:
C() { coutConstuct C
~C() { coutDestruct C
};
class D:public B, public C
{
public:
D(){ coutConstsruct D
~D(){ coutDestruct D
};
艾默生求职讨论区/forum-355-1.html
int main()
{
D *p = new D();
p-speak();
delete p;
}
输出:
Construct A
Construct B
原创力文档

文档评论(0)