Pointer to a base class can be initialized with the address of derived class, because of _________

Pointer to a base class can be initialized with the address of derived class, because of _________
A. derived-to-base implicit conversion for pointers
B. base-to-derived implicit conversion for pointers
C. base-to-base implicit conversion for pointers
D. derived-to-derived implicit conversion for pointers
 
Answer: a
Explanation: It is an implicit rule defined in most of the programming languages. It permits the programmer to declare a pointer to the derived class from a base class pointer. In this way the programmer doesn’t have to declare object for derived class each time it is required.
 

Tìm kiếm

Back
Top