Static Example int* func() { static int i = 42; i++; return &i; } int main() { int* p1 = func(); int* p2 = func(); cout << p1 << " : " << *p1 << endl; cout << p2 << " : " << *p2 << endl; }