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
Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?
What is c++ iterator?
Explain the volatile and mutable keywords.
Why pointer is used in c++?
What do you mean by early binding?
What is purpose of abstract class?
Write a code/algo to find the frequency of each element in an array?
What is the default width for ouputting a long integer using the insertion operator?
What things would you remember while making an interface?
What is std :: flush?
Are strings mutable in c++?
What is the auto keyword good for in c++?
What are the differences between java and c++?
what are function pointers?
Explain data encapsulation?