When the design recommends static functions?
Answers were Sorted based on User's Feedback
Answer / manu
The design reccommends static functions when you need to
call the function even when the class is not instantiated.
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / aruna kumar samal
When you want to use the function inside the program , not
outside then dsign recomend to do so. This does not have a
this pointer.static function maynot be virtual.there will
not be same version of static and non static function.
| Is This Answer Correct ? | 0 Yes | 3 No |
What is std :: endl?
What is scope of a variable? (LOLZ)
What is c++ array?
Should you pass exceptions by value or by reference?
What do you mean by static variables?
How do you allocate and deallocate memory in C++?
On throwing an exception by the animal constructor in p = new animalq, can memory leak occur?
Explain how to initialize a const member data.
Would you rather wait for quicksort, linear search, or bubble sort on a 200000 element array? (Or go to lunch...) a) Quicksort b) Linear Search c) Bubble Sort
What is virtual base class uses?
What are advantages and disadvantages of Design patterns?
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