• 코드:
​x
 
1
#include <stdio.h>
2
​
3
void local(void);
4
void staticVar(void);
5
​
6
int main(void)
7
{
8
    int i;
9
​
10
    for (i = 0; i < 3; i++)
11
    {
12
        local();
13
        staticVar();
14
    }
15
​
16
    return 0;
17
}
18
​
19
void local(void)
20
{
21
    int count = 1;
22
    printf("local() 함수가 %d 번째 호출되었습니다.\n", count);
23
    count++;
24
}
25
​
26
void staticVar(void)
27
{
28
    static int static_count = 1;
29
    printf("staticVar() 함수가 %d 번째 호출되었습니다.\n", static_count);
30
    static_count++;
31
}
32
​
표준입력 & 실행옵션