C++ MQCs with Explanation (CHAPTER : INHERITANCE : EXTENDING CLASSES

Consider the following code: class A { }; class B : A { }; What happens when we compile this code?

  1. Will not compile because the body of A is empty
  2. Will not compile because the body of B is empty
  3. Will not compile because the visibility mode for A is not specified
  4. Will compile successfully



Answer: 
Option d: Will compile successfully

Explanation Here

Post a Comment

0 Comments