s**3 发帖数: 191 | 1 For the following question, I don't see any correct answer, but it must has
a coorect answer. Could anyone answer it?
Which one of the following is true regarding a C++ class?
a) A pointer to an object can only be used to access its class's private
member functions if the pointer is in a member or friend function.
b) Whether specified or not, all C++ classes implicitly inherit from class
Object.
c) A C++ class must have at least one explicitly declared constructor.
d) Members of class A can access protected and private methods of class B if
class A is derived from B or if class B is a friend A.
e) A c++ class cannot be derived from a C structure defined with keyword
struct. | s*****e 发帖数: 33 | | a*******e 发帖数: 455 | | s**********r 发帖数: 117 | 4 A没看懂啥意思。
B C++里没有Object这个父类,除非自己写
C 不需要,编译器在需要的时候会自动生成默认构造函数,注意是需要的时候,不是一
直都回自动生成
D 错的
E 可以 |
|