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
Evaluate !(1&&1||1&&0) a) Error b) False c) True
What is object in c++ wikipedia?
What is a literal in c++?
When you overload member functions, in what ways must they differ?
Why do we use vector in c++?
What is tellg () in c++?
How can I learn c++ easily?
Which one is a preferred language C or C++? Why?
What is a c++ object?
What are the differences between java and c++?
Array base access faster or pointer base access is faster?
Is swift better than c++?
int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}
Why are pointers used?
Differences between private, protected and public and give examples.