I posted a question recently: Initialization of Static Class members.
Now please check this code:
#include
class A
{
static int o
The member obj_s is static this means it is defined independently of the class.
The line:
int A::obj_s=0;
Not only defines its value but also defines the memory it uses.
That is why in the previous question you were getting a linker error (no space had been allocated for 'obj_s`. Now that you have added the line the compiler is defined the memory location(s) used by the object and the program now links.