OC static 和变量

#include <stdio.h>
// 如果在不同源文件出现了同名的内部变量,那么这些变量将互不干扰
static int b;

// 用static修饰的全部变量,可以称为内部变量
static int a;

void testA() {
    printf("one.c中的a=%d
", a);
}

  调用:

static int b;

void testA();

extern int a;

int main(int argc, const char * argv[])
{
    a = 10;
    
    testA();
    return 0;
}

int a;
原文地址:https://www.cnblogs.com/liuwj/p/6899708.html