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

Evaluate !(1&&1||1&&0) a) Error b) False c) True

700


What is object in c++ wikipedia?

568


What is a literal in c++?

564


When you overload member functions, in what ways must they differ?

586


Why do we use vector in c++?

598






What is tellg () in c++?

717


How can I learn c++ easily?

618


Which one is a preferred language C or C++? Why?

615


What is a c++ object?

613


What are the differences between java and c++?

528


Array base access faster or pointer base access is faster?

1811


Is swift better than c++?

535


int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}

828


Why are pointers used?

577


Differences between private, protected and public and give examples.

575