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
Answers were Sorted based on User's Feedback
Answer / 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 |
Why do we use classes in programming?
Why seem interrupt handlers as member functions to be impossible?
What is an associative container in c++?
program in c++ to input digits and print in words
In C++ cout is: a) object b) class c) something else
11 Answers Infosys, Lehman Brothers,
How does throwing and catching exceptions differ from using setjmp and longjmp?
Explain rethrowing exceptions with an example?
How static variables and local variablesare similar and dissimilar?
Can you pass an array to a function in c++?
Explain one method to process an entire string as one unit?
What is flush c++?
What is unary operator? List out the different operators involved in the unary operator.