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 are manipulators in c++ with example?

1115


Write my own zero-argument manipulator that should work same as hex?

1101


Why is c++ a mid-level programming language?

1084


Explain what are the sizes and ranges of the basic c++ data types?

1202


Is empty stack c++?

1059


Can a program run without main in c++?

1288


Explain data encapsulation?

1168


Can I learn c++ without c?

1187


How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)?

1127


What is the difference between an external iterator and an internal iterator? Describe an advantage of the external iterator.

1116


Define a constructor - what it is and how it might be called (2 methods)?

1228


What size is allocated to the union variable?

1129


Why c++ is better than c language?

1069


Explain what is class definition in c++ ?

1197


What is oops in c++?

1113