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
Write about c++ storage classes?
what is c++
What is a class template in c++?
What is c++ manipulator?
What is a catch statement?
What is searching?
How do you initialize a string in c++?
What is data hiding c++?
What is a stack c++?
Write a program to encrypt the data in a way that inputs a four digit number and replace each digit by (the sum of that digit plus 7) modulus 10. Then sweep the first digit with the third, second digit with the fourth and print the encrypted number.
Define Virtual function in C++.
What is std :: endl?
If dog is a friend of boy and boy is a friend of house, is dog a friend of house?
Why can’t you call invariants() as the first line of your constructor?
Why c++ is faster than java?