iLe*_*oDo 1 c static local-variables
在这段代码,为什么在我的测试结果总是1,2和3?
#include <stdio.h>
void test() {
int a;
a++;
printf("%d",a);
}
int main(int argc, char *argv[]) {
test();
test();
test();
}
Run Code Online (Sandbox Code Playgroud)
我认为变量test()是静态的,不是吗?为什么?
| 归档时间: |
|
| 查看次数: |
832 次 |
| 最近记录: |