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 / 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 |
Post New Answer View All Answers
What is the use of turbo c++?
Can non graphic characters be used and processed in C++?
Is swift better than c++?
Is c++ vector a linked list?
Difference between a homogeneous and a heterogeneous container
What is name hiding in c++?
What is the role of C++ shorthand's?
What relational operators if statements in c++?
What is a rooted hierarchy?
What are pointer-to-members in C++? Give their syntax.
Which field is used in c++?
What is the size of a vector?
Explain the problem with overriding functions
You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. New() and malloc()
Explain deep copy and a shallow copy?