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 |
throw Can constructors exceptions?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
How do you define/declare constants in c++?
What about Virtual Destructor?
Eplain extern keyword?
What is an iterator class in c++?
What is a storage class?
What is the difference between struct and class?
What are the weaknesses of C++?
what is VOID?
Adobe Interview & Adobe Placement Paper
what kind of projects are suitable for c and c++