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

Can a function take variable length arguments, if yes, how?

959


What is the use of :: operator in c++?

1057


How important is c++?

924


Why c++ is so important?

1023


What do you mean by public protected and private in c++?

999


Is overriding possible in c++?

951


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

1004


What do the header files usually contains?

999


How can virtual functions in c++ be implemented?

1058


What is object oriented programming (oop)?

1070


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

987


Difference between a copy constructor and an assignment operator.

933


What is type of 'this' pointer? Explain when it is get created?

967


List the features of oops in c++?

988


How do you invoke a base member function from a derived class in which you have not overridden that function?

1070