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 scope operator in c++?
What is a c++ map?
how many trys can we write in one class
What is cout flush?
What is pointer in c++ with example?
Is C++ case sensitive a) False b) Depends on implementation c) True
What is a constructor in c++ with example?
Can notepad ++ run c++?
What are the uses of typedef in a program?
What is a dangling pointer in c++?
How do you find out if a linked-list has an end?
What is array in c++ example?