On Dec 19, 4:45 am, Rahul <sam_...@yahoo.co.inwrote:
On Dec 19, 1:00 am, "parag_p...@hotmail.com"
<parag_p...@hotmail.comwrote:
Can a class with out any instances present have it static
members updated.
If yes, on which object does the update happen.
But yes one needs to make sure that they are initialized once
before any usage.
That's true for most variables, but not for static POD types,
which are automatically zero initialized before any code is run.
The initialization makes sure that the memory is allocated for
the static member variables.
The initialization of a static variable has nothing to do with
memory allocation.
Any usage of static member variables without initialization
could cause unresolved external symbol linker error...
You'll likely get an unresolved external symbol error from the
linker if you fail to define the symbol, but the linker doesn't
care in the least about initialization.
--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34