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
Write a function to find the nth item from the end of a linked list in a single pass.
What is different in C++, compare with unix?
What is the difference between a definition and a declaration?
What is constant in c++ with example?
What is the full name of logo?
Declare a class vehicle and make it an abstract data type.
What is rvalue?
Tell me what are static member functions?
What is the use of vtable?
Can I have a reference as a data member of a class? If yes, then how do I initialise it?
what is c++
What is boyce codd normal form in c++?
Why do we use constructor?
Why do we use structure in c++?
Why c++ is created?