Logo 
Search:

C++ Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C++ ProgrammingRSS Feeds

which class members does the derived class inherit from base class? - select option

  Shared By: Hayden Evans    Date: Sep 27    Category: C++ Programming    Views: 946

Answer:

5. According to the following code, which of the following class members does the derived class inherit from the base class?
class base
{
float x;
int y;
public:
int a;
void get_a();
void put_a();
}
class derived : public base
{
// members of B
}

Option

a) float x
b) int y
c) get_a(), void put_a()
d) All of the above

Answer : c) get_a(), void put_a()

Share: 
 



Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: