// This code illustrates the use of a static member variable. // It’s not supposed to compile. #include using namespace std; class Foo { public: Foo() { cout << "Hi there " << counter++ << '\n'; } private: static int counter; }; int main() { Foo f; } // int Foo::counter; // uncomment to compile