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
How do you declare A pointer to function which receives an int pointer and returns a float pointer
What is a map in c++?
Can a program run without main function?
What is general format for a prototype?
what is software cycle? What is a mission critical system ? What is the important aspect of a real-time system ? Explain the difference between microkernel and macro kernel. Give an example of microkernel.Why paging is used ? Which is the best page replacement algo and Why ? What is software life cycle ? How much time is spent usually in each phases and why Which one do U want to work if selected in Honeywell ? Which are the different types of testing ? What is a distributed system ? Some questions about CSP. Which languages do U know ? What are the differences between Pascal and C. questions from Compiler construction and Lisp. Which are the different computer architecture? What is the requirement in MIMD ? What is the difference between RISC and CISC processors ? Difference between loosely coupled and tightly coupled systems ? What is an open system?
what are function pointers?
Is it possible to provide default values while overloading a binary operator?
What is the real purpose of class – to export data?
What is a singleton c++?
Can you overload the operator+ for short integers?
What is the difference between an array and a list?
What is while loops?
What are the new features that iso/ansi c++ has added to original c++ specifications?
What is private inheritance?
What is a multimap c++?