class Foo {
public:
Foo(int i) { }
};
class Bar : virtual Foo {
public:
Bar() { }
};
Bar b;
Referring to the above code, when the object 'b' is defined,
a compiler error will occur. What action fixes the compiler
error?
a) Adding a virtual destructor to the class Bar
b) Adding a constructor to Bar which takes an int parameter
c) Adding "Foo()" to the Bar constructor
d) Adding a copy constructor to the class Foo
e) Adding "Foo(0)" to the Bar::Bar initializer list
Answer Posted / guest
Ans. E
Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
Explain static and dynamic memory allocation with an example each.
Should I learn c++ c?
Can constructor be static in c++?
What is abstraction with real time example?
What is function overloading c++?
Which function cannot be overloaded c++?
How do you invoke a base member function from a derived class in which you’ve overridden that function?
What is c++ flowchart?
What are references in c++?
Explain the isa and hasa class relationships.
what is VOID?
What is the difference between *p++ and (*p)++ ?
How does com provide language transparency?
Differentiate between a constructor and a destructor in c++.
What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?