Mega Code Archive
Categories
/
C
/
Code Snippets
Recursive function with static variable
#include
void f(void); int main(void) { f(); return 0; } void f(void) { static int j = 0; j++; if(j == 10) return; printf("%d ", j); f(); /* recursive call */ }