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

What is a list c++?

1100


What is the purpose of ios::basefield in the following statement?

1247


What is the full form of stl in c++?

1180


How do pointers work?

1171


What is the difference between reference and pointer?

1133


What does it mean to declare a member function as static?

1049


How do you clear a map in c++?

1115


Explain what happens when a pointer is deleted twice?

1240


Which is the best c++ software?

1084


Which software is used to run c++ program?

983


Discuss the effects occur, after an exception thrown by a member function is unspecified by an exception specification?

1059


Differentiate between the message and method in c++?

1054


What will strcmp("Astring", "Astring"); return a) A positive value b) A negative value c) Zero

1084


Who was the creator of c++?

1033


Write about the retrieval of n number of objects during the process of delete[]p?

1006