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 / mpoleg

c)
all other options are not valid c++

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If dog is a friend of boy, is boy a friend of dog?

928


Write some differences between an external iterator and an internal iterator? Describe the advantage of an external iterator.

1011


Differences between private, protected and public and give examples.

997


Is it possible to have a recursive inline function in c++?

976


What is the use of vtable?

1094


What is function prototyping?

1039


Why iomanip is used in c++?

1070


What is the operator in c++?

1069


How do I download c++?

961


what is data encapsulation in C++?

1009


How do you write a function that can reverse a linked-list?

1048


Can member data be public?

989


Explain the concept of dynamic allocation of memory?

1043


Explain what happens when a pointer is deleted twice?

1183


What is the difference between function overloading and operator overloading?

1031