程序员面试题精选100题(53)-C++/C#面试题(2)

面试题 时间:2019-09-22 手机网站
z的地址(pPoint的地址0z的偏移量8),并不需要访问pPoint指向的内存。只要不访问非法的内存,程序就不会出错。

题目(七):运行下列C++代码,输出什么?

class A

{

public:

        A()

        {

                Print();

        }

        virtual void Print()

        {

                printf("A is constructed.\n");

        }

};

 

class B: public A

{

public:

        B()

        {

                Print();

        }