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 |
how to explain our contribution in the project?
What is the best free c++ compiler for windows?
Write a program to calculate the BMI of a person using the formula BMI = weight/height2.
What is a virtual destructor? Explain the use of it?
What is enum class in c++?
Where is atoi defined?
Explain the difference between c & c++?
Can we get the value of ios format flags?
What do you understand by pure virtual function? Write about its use?
WHO DEVELOPED C++?
Difference between overloaded functions and overridden functions
What ANSI C++ function clears the screen a) clrscr() b) clear() c) Its not defined by the ANSI C++ standard