I want to know if I have a static variable within a class member function if that variable will only have an instance for that class or for each object of that class. Here’s an example of what I want to do.
class CTest
{
public:
testFunc();
};
CTest::testFunc()
{
static list<string> listStatic;
}
Is listStatic per instance or per class?
It is per that function
CTest::testFunc()– each invokation of that member function will use the same variable.