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 |
Who discovered c++?
wrong statement about c++ a)code removably b)encapsulation of data and code c)program easy maintenance d)program runs faster
advantages and disadvantages of using Borland C++ / version 5.
What is c++ iterator?
Define precondition and post-condition to a member function?
Which operator cannot overload?
You run a shell on unix system. How would you tell which shell are you running?
What is size of empty class object
What is DlgProc?
What is function overriding?
What does scope resolution operator do?
Define a conversion constructor?