// This is C++ void f() { static int myvar=myfunc(); // will be initialized only at the first call of f() ... g(++myvar); // Incremented on every call }