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
Can you declare an array without a size in c++?
What size is allocated to the union variable?
What is stream and its types in c++?
Does c++ support multilevel and multiple inheritances?
What is the return value of the insertion operator?
What is the protected keyword used for?
Can I learn c++ in a week?
Explain what is oop?
Difference between delete and free.
What is the C-style character string?
What is null pointer and void pointer?
What is an orthogonal base class in c++?
What is the operator in c++?
Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
Can non graphic characters be used and processed in C++?