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

What are the advantages of pointers?

1068


What do you mean by function overriding & function overloading in c++?

1194


Am pass the 10000 records to target in target I will take commit interval 15000 when I was stop the work flow what will happened

1563


What is difference between class and function?

1097


What are the 3 levels of programming languages?

1051


Explain some examples of operator overloading?

1126


What does new in c++ do?

1027


What is the type of 'this' pointer? When does it get created?

957


Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;

2017


Which coding certification is best?

1033


What is istream c++?

1201


Comment on local and global scope of a variable.

1166


How to demonstrate the use of a variable?

1124


How do you define/declare constants in c++?

1054


What's the most powerful programming language?

1041