static variable

Why we need to assign memory explicitly for static variables?

like int Base::m;

can any one please explain?
Last edited on
The same reason we need to give a body to a function we have only declared a prototype for. Please think about that and see if you can come up with some specific reasoning yourself. ;)
but here static int m; is not a functon so how can we declare like that?
static int m; is basically a prototype for the variable, saying that the name exists but nothing more than that.
Topic archived. No new replies allowed.