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 |
When does a name clash occur?
how is returning structurs from functions?Show an eg?
CAN U SAY WHICH PROGRAMING LANGUAGE IS USED BY DOCTORS....?
What are the differences between a struct in C and in C++?
How would you use the functions memcpy(), memset(), memmove()?
Is python written in c or c++?
What are advantages of using friend classes?
What is setiosflags c++?
What is the role of C++ shorthand's?
What kind of jobs can I get with c++?
State two differences between C and C++.
What is a local reference?