考试题,哪位大侠帮忙搂搂?多谢!

考试题,哪位大侠帮忙搂搂??谢谢!!
二)、分析下面的代码,回答问题(每题 10 分,共 40 分)
1.下面程序的执行结果是什么?为什么?
class B{
protected:
virtual void f( ){cout<<"B"<<endl;}
public:
void g( ){f( );}
};
class C:public B{
protected:
void f( ){cout<<"C"<<endl;}
};
void main( ) {
    C d;
    d.g( );
}

2.下面程序的执行结果是什么?为什么?
class BC {
public:
    BC( ) { cout << "BC' constructor\n"; }
    ~BC( ) { cout << "BC' destructor\n"; }
};
class DC : public BC {
public:
    DC( ) { cout << "DC' constructor\n"; }
    ~DC( ) { cout << "DC' destructor\n"; }
};
int main( ) {
    DC d;
    return 0;
}

3. 下面程序的执行结果是什么?为什么?
 void main()
{
  char* pn[]={"Fred","Barney","Wilma","Betty",NULL};
  print(pn);
}
void print(char* arr[])
{
  while(*arr!=NULL){ 
    cout << *arr <<endl;
    arr++;
  }
}

4.下面程序的执行结果是什么?为什么?

class B
{
int b;
public:
B(){};
B(int i){b=i;};
virtual void func()
{
cout<<"B::func() called"<<endl;
}
};

class D:public B
{
public:
D(){};
D(int i, int j):B(j){d=j;}
private:
int d;
void func()
{
cout<<"D::func() called"<<endl;
};
};
void gfunc(B *obj)
{
obj->func();
}

void main()
{
D *pd=new D;
gfunc(pd);
}
序的执行结果

------解决方案--------------------
C++啊   没学过    帮顶一次
------解决方案--------------------
3, 打他pp, 还在用void main()
Fred
Barney
Wilma
Betty
------解决方案--------------------
不要迷信书、考题、老师、回帖;
要迷信CPU、编译器、调试器、运行结果。
并请结合“盲人摸太阳”和“驾船出海时一定只带一个指南针。”加以理解。
任何理论、权威、传说、真理、标准、解释、想象、知识……都比不上摆在眼前的事实!

------解决方案--------------------
1.  C                // 派生类把基类的函数覆盖了
2.  BC'constructor   // 这个考察对象的构造和析构的顺序吧
    DC' constructor
    DC' desctructor
    BC' Destrunctor
3.  Fred             // 指向指针的指针的使用
    Barney
    Wilma
    Betty
4.  D::func() called  // 派生类把基类的函数覆盖了
------解决方案--------------------
对照书上基础知识,调试跟踪一把,不就都明了了
------解决方案--------------------
楼上正解,自己调试跟踪最可靠~