Answer Posted / reejusri
Static function is basically used in creating factory
objects.
You can make your constructor private and expose static
function. And user can use the static methods to create the
object of that class.
Using NONSHARABLE_CLASS you can restrict the usage of
static functions/method also.
| Is This Answer Correct ? | 15 Yes | 16 No |
Post New Answer View All Answers
Where the memory to the static variables is allocated?
What does asterisk mean in c++?
Explain the virtual inheritance in c++.
What is an adaptor class in c++?
What can c++ be used for?
Why is c++ called oops?
What is null and void pointer?
Discuss the effects occur, after an exception thrown by a member function is unspecified by an exception specification?
What is the use of seekg in c++?
Give example of a pure virtual function in c++?
What is the difference between while and do while loop?
What is the size of integer variable?
Why are arrays usually processed with for loop?
What is the difference between a baller and a reference in C++?
Can you declare an array without a size in c++?