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

Write about c++ storage classes?

755


what is c++

1804


What is a class template in c++?

527


What is c++ manipulator?

555


What is a catch statement?

587






What is searching?

657


How do you initialize a string in c++?

565


What is data hiding c++?

601


What is a stack c++?

575


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.

2097


Define Virtual function in C++.

627


What is std :: endl?

596


If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

555


Why can’t you call invariants() as the first line of your constructor?

562


Why c++ is faster than java?

598