Thanks heaps, guys. People are always so helpful in this forum.
To Ron:
Create a static variable (or class instance)
Do you mean either:
1) create the counter as a static variable OR
2) create it as a separate class?
Then in the constructor increment the counter and in the destructor
decrement.
This would only be good for tracking the number of objects in
existence, wouldn't it? I want to keep track of the total number of
objects created, regardless of whether or not they've been destroyed.
-----------------
To Sumit:
Thanks for that code. Now I understand static variables. A question:
is this good code? I know it works, but is it written according to
best practice?
Another question: In your call to the static variable you specify an
object - i.e. "a.tc". Is there a way to do this without calling a
specific object?
Cheers,
Deets