【单选题】【消耗次数:1】
类B是类A的公有派生类,类A和类B中都定义了虚函数func(),p是一个指向类A对象的指针,则p-A::func()将()
调用类A中的函数func()
调用类B中的函数func()
根据p所指的对象类型而确定调用类A中或类B中的函数func()
既调用类A中函数,也调用类B中的函数
参考答案:
复制
纠错
相关题目
【单选题】 类B是类A的公有派生类,类A和类B中都定义了虚函数func(),p是一个指向类A对象的指针,则p->A::func()将()
①  调用类A中的函数func()
②  调用类B中的函数func()
③  根据p所指的对象类型而确定调用类A中或类B中的函数func()
④  既调用类A中函数,也调用类B中的函数
【单选题】 当一个类的某个函数被说明为virtual时,该函数在该类的所有派生类中()
①  都是虚函数
②  只有被重新说明时才是虚函数
③  只有被重新说明为virtual时才是虚函数
④  都不是虚函数
【单选题】 在创建派生类对象时,构造函数的执行顺序是()
①  对象成员构造函数―基类构造函数―派生类本身的构造函数
②  派生类本身的构造函数―基类构造函数―对象成员构造函数
③  基类构造函数―派生类本身的构造函数―对象成员构造函数
④  基类构造函数―对象成员构造函数―派生类本身的构造函数
【单选题】 已知类A是类B的友元,类B是类C的友元,则()
①  类A一定是类C的友元
②  类C一定是类A的友元
③  类C的成员函数可以访问类B的对象的任何成员
④  类A的成员函数可以访问类B的对象的任何成员
【单选题】 类的构造函数被自动调用执行的情况是在定义该类的()
①  成员函数时
②  数据成员时
③  对象时
④  友元函数时
【单选题】 程序中撤销一个类对象时,系统自动调用()
①  成员函数
②  构造函数
③  析构函数
④  友元函数
【单选题】 f1()函数是类A的公有成员函数,p是指向类的成员函数f1()的指针,下列表示中正确的是()。
①  p=f1()
②  p=f1
③  p=A::f1
④  p=A::f1()
【单选题】 类的构造函数在以下什么情况下会被自动调用( )
①  定义成员函数时
②  定义对象时
③  定义数据成员时
④  定义友元函数时
【单选题】 类的构造函数在以下什么情况下会被自动调用( )
①  定义成员函数时
②  定义对象时
③  定义数据成员时
④  定义友元函数时
【单选题】 派生类的构造函数的成员初始化列表中,不能包含()。
①  基类的构造函数
②  派生类中子对象的初始化
③  基类的子对象初始化
④  派生类中一般数据成员的初始化
随机题目
【单选题】 Should you jog too? If you do, be sure to ask your doctor for_________ .
①  advice
②  bench
③  distance
④  success
【单选题】 Ill finish my adult education courses_________ two years.
①  in
②  on
③  until
④  by
【单选题】 _________ the early nineteenth century, people did not use stamps.
①  In
②  On
③  As
④  For
【单选题】 When a program has a small number of people_________ it, it is discontinued.
①  looking
②  watching
③  hearing
④  listening
【单选题】 You can_________ yourself to remember better.
①  train
②  test
③  try
④  think
【单选题】 You cannot remember things_________ you are tired or unhappy.
①  why
②  what
③  where
④  when
【单选题】 Jogging makes the heart stronger and helps people lose_________.
①  weight
②  length
③  height
④  width
【单选题】 I want to mail this letter to the U.S.._________ is the postage, please?
①  How many
②  How much
③  How often
④  How long
【单选题】 I asked some policemen to tell me the way home. They smiled and answered me_________ .
①  slowly
②  heavily
③  politely
④  rudely
【单选题】 You can increase your_________ a quarter or half mile every two weeks or so.
①  difficulty
②  discovery
③  disagreement
④  distance