Live example for static function?



Live example for static function?..

Answer / 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

More C++ General Interview Questions

What do you mean by funtion prototype?

0 Answers  


Difference between strdup and strcpy?

0 Answers  


What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random

0 Answers  


wrong statement about c++ a)code removably b)encapsulation of data and code c)program easy maintenance d)program runs faster

11 Answers  


Can I learn c++ without knowing c?

0 Answers  






Define the process of error-handling in case of constructor failure?

0 Answers  


can output 5 students using one dimensional array

1 Answers   Intel,


What is lazy initialization in c++?

0 Answers  


Can I have a reference as a data member of a class? If yes, then how do I initialise it?

0 Answers  


In c++, what is the difference between method overloading and method overriding?

0 Answers  


Problem 5: Hero's Formula is A method for calculating the area of a triangle when you know the lengths of all three sides. Let a, b, c be the lengths of the sides of a triangle. The area is given by:A= pp-ap-b(p-c) | wherep= a+b+c2 | | Write a C-language code to calculate area of triangle using above method. Take the three lengths of the triangle from the user and display the area that your program calculates.

0 Answers   Maxobiz,


write a C++ programming using for loop: * * * * * * * * * *

4 Answers   TCS,


Categories