gpt4 book ai didi

c - C中的重复声明全局变量

转载 作者:太空狗 更新时间:2023-10-29 17:24:07 25 4
gpt4 key购买 nike

<分区>

为什么这在全局范围内有效:

static int a;
static int a=0;

但不在函数体内:

void foo()
{
static int b;
static int b=0; //error: Duplicate declaration of global variable 'b'
...

使用 clion 2017.3.1、C99、gcc5.4

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com