使用static关键字声明外部变量
file1.c
static int A;
file2.c
extern int A;
void main() {
...
}
void fun(int n) {
...
A = A * n;
}
文件大小:7.98MB
file1.c
static int A;
file2.c
extern int A;
void main() {
...
}
void fun(int n) {
...
A = A * n;
}
评论区