设为首页收藏本站language 语言切换
查看: 2106|回复: 0
收起左侧

Adobe公司笔试题

[复制链接]
发表于 2010-5-31 15:20:11 | 显示全部楼层 |阅读模式
Adobe公司笔试题

1、(10%) what is the rule of class D_*,UserClass, and client class of D_* and UserClass to access the member of class B?
class B
{/*……..*/};
class D_pri:private B {/**…….*/}
class D_Publ: public B {/**….*/}
class UserClass
{B b;/**..*/}

2 write the output
#include
#include
using namespace std;
void println(const std::string& msg)
{
std:cout<}
class Base{
public:
Base() {println(“Base::Base()”);Virt();}
Void f(){println(“Base::f()”);Virt();}
Virtual void virt(){println(“Base()::virt()”);}
};
class Derived:public Base
{
Derived(){println(“Derived:: Derived ()”);Virt();}
Virtual void virt(){println(“Derived ()::virt()”);}
};
int main(int argc,char* argv[])
{
Derived d;
Base *pB=&d;
PB->f();
}
2.1 (5%) what is the output of the code “pB->f();” above?
2.2 (5%) what is the output of the code “Dervied d;” above?
您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-2-24 11:04 , Processed in 0.058270 second(s), 22 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表