Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



class Foo { public: Foo(int i) { } }; class Bar : virtual Foo { public: Bar() { }..

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

class Foo { public: Foo(int i) { } }; class Bar : virtual Foo { public: Bar() { }..

Answer / guest

Ans. E

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More C++ General Interview Questions

how to explain our contribution in the project?

0 Answers   Wipro, Yahoo,


What is the best free c++ compiler for windows?

0 Answers  


Write a program to calculate the BMI of a person using the formula BMI = weight/height2.

2 Answers  


What is a virtual destructor? Explain the use of it?

0 Answers  


What is enum class in c++?

0 Answers  


Where is atoi defined?

0 Answers  


Explain the difference between c & c++?

0 Answers  


Can we get the value of ios format flags?

0 Answers  


What do you understand by pure virtual function? Write about its use?

0 Answers  


WHO DEVELOPED C++?

6 Answers  


Difference between overloaded functions and overridden functions

0 Answers  


What ANSI C++ function clears the screen a) clrscr() b) clear() c) Its not defined by the ANSI C++ standard

0 Answers  


Categories