>why does it need to be defined as int again?
it is not defined again, it is initialized. You must initialize static members outside class declaration and outside .h files.
Yesyes, but the question is I think why do you have to write it int something::N = 0;
when one would think
something::N = 0;
technically could be enough.
/Per
[sub]
if (typos) cout << "My fingers are faster than my brain. Sorry for the typos.";
[/sub]
I did not know Mr Stroustrup took the time to answer (lame) questions like my own ) lol
Actually he's got a point there, bit where do you draw the line? If you keep going in the same direction, you'd end up declaring a variable every time you use it... :/
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.