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 / man
class Foo {
public:
Foo(int i) { }
};
class Bar : virtual Foo {
public:
Bar():Foo(0) { }
};
Ans e
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
What are references in c++?
Write a Program for find and replace a character in a string.
Explain the different access specifiers for the class member in c++.
When you overload member functions, in what ways must they differ?
When should we use container classes instead of arrays?
What is time_t c++?
What do you understand by zombie objects in c++?
How do you clear a buffer in c++?
what is the use of void main() in C++ language?
Define the operators that can be used with a pointer.
Differentiate between an external iterator and an internal iterator?
What do you understand by a pure virtual member function?
What is an associative container in c++?
Explain differences between alloc() and free()?
what is c++