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

Define a conversion constructor?

1040


Can we use struct in c++?

982


Are there interfaces in c++?

956


Does c++ vector allocate memory?

955


What is the function to call to turn an ascii string into a long?

1012


Is python written in c or c++?

1117


Explain function overloading

971


Carry out conversion of one object of user-defined type to another?

1002


How to tokenize a string in c++?

1017


What is static in c++?

1020


Explain what is class definition in c++ ?

1061


What do you mean by inheritance in c++? Explain its types.

1080


What does #define mean in c++?

1219


What are stacks? Give an example where they are useful.

1003


What is void pointer in c++ with example?

1035