Static variables in member functions
Can someone please explain how static variables in member functions work in C++. Given the following class: class A { void foo() { static int i; i++; } } If I declare multiple instances of A, does calling foo() on one instance increment the static variable i on all instances? Or only the one it … Read more