Practice · 1 of 4
Static Counter
CHALLENGE
Difficulty: beginner+25 XP
Implement int next_id(void) returning 1 on the first call, 2 on the second, 3 on the third — using a static local (no globals).
Press Submit to check your solution.
Back to lesson: Practice: Scope & Storage