Static variable in member function


I need to keep a static variable in a member function of a class that I have many objects of. I've had some trouble with it, and when I read up I found that such variables are static across all instances. Is there any way around this?
The workaround is to make it a non-static member variable.
such variables are static across all instances

Well, yes. That's what "static" means, in this context!

What are you trying to achieve?
Last edited on
Hehe, I realized just too late that it was that easy :P I didn't realize it would be static across instances,I thought it was only across function calls.
Topic archived. No new replies allowed.