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 is a syntax in c++?
write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)
Perform addition, multiplication, subtraction of 2-D array using Operator Overloading.
What are protected members in c++?
What is a singleton class c++?
What is a storage class used in c++?
What is using namespace std in cpp?
What programming language should I learn first?
What are shallow and deep copies?
Array base access faster or pointer base access is faster?
How long will it take to learn programming?
Is it possible to have a recursive inline function in c++?
Explain the concept of memory leak?
what Is DCS ? what i will get benefit when i did?
What is #include math h in c++?