A static function inside a class is basically the same as a function outside the class:
class myClass
{
public:
int iAdd(int a, int b);
};
int sFunc()
{
return iAdd(124,142);
}
Pretty weird, isn't it?
The only differences between a static method and a function outside the class is that a static method can see the private members of the class while the outer function doesn't, and code outside the class can access the outer function while the static method might be put to protected or private hiding it from most of the outer world.
Inside a static method you can reach even private members of the specified class but you have to pass somehow an instance of that class to that function first (because static methods are like normal functions, without a this pointer to a class instance). For example if you instantiate an instance of myClass as a global variable then your static method can access it, or you can simulate the this pointer by passing in a myClass instance as a parameter to your static method, or you can just create an instance for yourself inside the static method like the meyer's singleton pattern:
class myClass
{
public:
static myClass& GetInstance()
{
static myClass g_Instance;
return g_Intance;
}
private:
myClass() {}
};
myClass& GetInstance()
{
static myClass g_Instance;
return g_Intance;
}