- 论坛徽章:
- 0
|
原帖由 zyb2000 于 2008-11-6 01:36 发表 ![]()
16. When a Copy Constructor is not written for a class, the C++ compiler generates one. Which of the following statements correctly describe the actions of this compiler-generated Copy Constructor when invoked?
A. The compiler-generated Copy Constructor makes the object being constructed, a reference to the object passed to it as an argument.
B. The compiler-generated Copy Constructor does not do anything by default.
C. The compiler-generated Copy Constructor performs a member-wise copy of the object passed to it as an argument, into the object being constructed.
D. The compiler-generated Copy Constructor tags the object as having been Copy-Constructed by the compiler.
E. The compiler-generated Copy Constructor invokes the assignment operator of the class.
这题疑问不大,应该选C
A如果后一句“a reference to the object passed to it as an argument”改成“a CONST reference to the object passed to it as an argument”才算对。
原帖由 zyb2000 于 2008-11-6 01:36 发表 ![]()
17. Which of the following must be ensured in order to implement a polymorphic function in C++?
A. There has to be a pointer of the derived class that has implemented the polymorphic function that holds the address of the derived class object.
B. The function must be declared as virtual in both the base class and in the derived class that overrides the function.
C. The function must be declared as pure virtual.
D. There has to be a base class pointer holding the address of a base or derived class object that has implemented the polymorphic function.
E. The function must be declared as virtual in the base class.
E没问题,蛮考语言的
[ 本帖最后由 zyb2000 于 2008-11-9 05:33 编辑 ] |
|