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
What are references in c++?
Explain the difference between abstract class and interface in c++?
Show the declaration for a static function pointer.
How many different levels of pointers are there?
If I is an integer variable, which is faster ++i or i++?
What is a container class? What are the types of container classes in c++?
What is oop in c++?
When does the c++ compiler create temporary variables?
What is friend class in c++ with example?
What is the difference between public, private, and protected access?
What are the methods of exporting a function from a dll?
How to defines the function in c++?
What is c++ try block?
What is the extraction operator and what does it do?
Explain the concept of copy constructor?