Live example for static function?

Answer Posted / sachinmundhra

Live Example for static function is Singleton class.

Static Method is used and called to get the instance of
class.

class Base
(
private:
Base()
public:
static Base* GetObject() // This is a static method
};

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a terminating character in c++?

1033


Can constructor be private in c++?

784


What is the use of main function in c++?

750


Are strings mutable in c++?

900


What is function overriding in c++?

816


Is recursion allowed in inline functions?

809


Explain how the virtual base class is different from the conventional base classes of the opps.

908


Explain what happens when a pointer is deleted twice?

1011


What are the classes in c++?

853


Are php strings immutable?

791


What is the use of register keyword with the variables?

753


Explain the extern storage classes in c++.

778


Difference between declaration and definition of a variable.

894


What is input operator in c++?

800


What is the need of a destructor? Explain with the help of an example.

799