1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #include <stdio.h> void sub(void) { int auto_count = 0; static int static_count = 0; auto_count++; static_count++; printf("auto_count=%d\n", auto_count); printf("static_count=%d\n", static_count); } int main(void) { sub(); sub(); sub(); return 0; } | cs |