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 / guest

Ans. E

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?

739


What is c++ iterator?

639


Explain the volatile and mutable keywords.

614


Why pointer is used in c++?

610


What do you mean by early binding?

599






What is purpose of abstract class?

582


Write a code/algo to find the frequency of each element in an array?

599


What is the default width for ouputting a long integer using the insertion operator?

685


What things would you remember while making an interface?

561


What is std :: flush?

574


Are strings mutable in c++?

692


What is the auto keyword good for in c++?

617


What are the differences between java and c++?

528


what are function pointers?

576


Explain data encapsulation?

601