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
Answers were Sorted based on User's Feedback
Answer / 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 |
What is the header file for setw?
Explain binary search.
What is an Iterator class?
What do you mean by volatile and mutable keywords used in c++?
What are dynamic type checking?
what is data abstraction in C++?
Difference between delete and free.
Define inline function
What is anonymous object in c++?
What is an iterator class in c++?
If there are two catch statements, one for base and one for derived, which should come first?
Can you pass an array to a function in c++?