int id; class foo { public: static int foo_global; }; int foo::foo_global = 1; int foo () { static int fook=0; id-=fook++; // ignore local vars int i = id-1; id -=i; id -= foo::foo_global; }