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 Alpha {
public:
char data[10000];
Alpha();
~Alpha();
};
class Beta {
public:
Beta() { n = 0; }
void FillData(Alpha a);

private:
int n;
};
How do you make the above sample code more efficient?
a) If possible, make the constructor for Beta private to
reduce the overhead of public constructors.
b) Change the return type in FillData to int to negate the
implicit return conversion from "int" to "void".
c) Make the destructor for Alpha virtual.
d) Make the constructor for Alpha virtual.
e) Pass a const reference to Alpha in FillData

Answer Posted / guest

pass a const reference to Alpha in FillData i.e Ans e)

Is This Answer Correct ?    16 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain mutable storage class specifier.

1092


What can I safely assume about the initial values of variables which are not explicitly initialized?

1061


What is the use of string in c++?

1029


What are proxy objects in c++?

1188


What is pure virtual function?

1067


What is difference between rand () and srand ()?

1088


What does flush do c++?

1067


What do you understand by zombie objects in c++?

1102


In inline " expression passed as argument are evalauated once " while in macro "in some cases expression passed as argument are evaluated more than once " --> i am not getting it plz help to make me understand....

2423


What are destructors?

1016


How many static variables are created if you put one static member into a template class definition?

1048


Explain how the virtual base class is different from the conventional base classes of the opps.

1171


What is a hashmap c++?

1123


What is new in c++?

1101


Who made c++?

1089