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


Please Help Members By Posting Answers For Below Questions

What is the use of turbo c++?

551


Can non graphic characters be used and processed in C++?

697


Is swift better than c++?

532


Is c++ vector a linked list?

542


Difference between a homogeneous and a heterogeneous container

657






What is name hiding in c++?

605


What is the role of C++ shorthand's?

669


What relational operators if statements in c++?

636


What is a rooted hierarchy?

673


What are pointer-to-members in C++? Give their syntax.

615


Which field is used in c++?

630


What is the size of a vector?

572


Explain the problem with overriding functions

596


You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. New() and malloc()

586


Explain deep copy and a shallow copy?

600