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
In c++, what is the difference between method overloading and method overriding?
What are the implicit member functions of class?
What is difference between n and endl in c++?
What are the various arithmetic operators in c++?
What is the best book for c++ beginners?
daily Routine of father
What is a class template in c++?
Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
What are the differences between java and c++?
Explain about templates of C++.
Write a code/algo to find the frequency of each element in an array?
What is stack unwinding?
What is the identity function in c++? How is it useful?
What are c++ storage classes?
Differentiate between realloc() and free().