Hi,
Static member function and member variables are class attributes .. and others are object attributes. In other words, say,In class C1, function F1 and variable V1 are static and function F2 and variable V2 are normal i.e.auto. Then,
1. Function F1 can use variable V1 but not V2.
2. Function F2 can use variables V1 and V2.
3. Function F1 and variable V1 has to accessed using class like C1::F1() and C1::V1.
4. Function F2 and variable V2 has to be accessed using object like O1.F2() and O1.V2, where O1 is C1 instance.
Static functions and variables are normally used in singleton class where constructor is made private. For eg.
class mySingleton{
public:
static mySingleton * getSingletonPtr();
private:
mySingleton();
static mySingleton * mySingletonPtr;
};
Now, get the pointer to my singleton class as .....
mySingletonPtr *ptr = mySingleTon::getSingletonPtr();
hope this helps.
regards,
Mahesh