int a = 0;
char *p1;
static int x = 10;
int main(void)
{
int b = 0;
char s1[] = "123";
char *p2;
char *s2 = "123";
static int c =0;
p1 = (char *)malloc(128);
p2 = (char *)malloc(256);
free(p1);
free(p2);
return 0;
}
静态区
.data:全局初始化的变量
.bss:全局未初始化变量
.rdata:全局只读
全局变量同一个文件中先定义先初始化,不同不确定
转载作者https://blog.csdn.net/youyou519/article/details/82701083