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

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


Please Help Members By Posting Answers For Below Questions

Should the this pointer can be used in the constructor?

971


What are the types of array in c++?

1091


What is data abstraction? How is it different from data encapsulation?

943


What is the difference between passing by reference and passing a reference?

1023


What is do..while loops structure?

1084


Explain the term memory alignment?

1159


Is vector a class in c++?

979


We use library functions in the program, in what form they are provided to the program?

1034


the first character in the variable name must be an a) special symbol b) number c) alphabet

1040


Explain 'this' pointer and what would happen if a pointer is deleted twice?

1015


What is an undefined reference/unresolved external symbol error and how do I fix it?

1078


What is #include math h in c++?

1025


Which is better c++ or java?

928


How come you find out if a linked-list is a cycle or not?

988


Is there any difference between int [] a and int a [] in c++?

943