Why static functions always uses static variables?

Answer Posted / george from psg

static function is constant to all object. In the same way
static variable is constant to all so we use static variable
in static function

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is oop useful?

813


How to call a non virtual function in the derived class by using base class pointer

5896


Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.

2212


How to use CMutex, CSemaphore in VC++ MFC

4537


Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.

924


Can a varargs method be overloaded?

810


What is coupling in oops?

818


What is polymorphism in oops with example?

758


They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?

1616


What is the benefit of oop?

768


What is the renewal class?

2411


if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

3112


What is object-oriented programming? Webopedia definition

950


What are oops methods?

758


What is the real life example of polymorphism?

848