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
Can you pass a vector to a function?
Why do we need constructors in c++?
What are the rules about using an underscore in a c++ identifier?
what is a reference variable in C++?
Can we overload operator in c++?
Define upcasting.
How many namespaces are there in c++?
Write about the stack unwinding?
What are abstract data types in c++?
Why main function is special in c++?
What happens if a pointer is deleted twice?
What is c++ best used for?
What is different in C++, compare with unix?
In c++, what is the difference between method overloading and method overriding?
What is the difference between a baller and a reference in C++?