Is it possible that a variable declared after the main has file scope?

后端 未结 3 664
隐瞒了意图╮
隐瞒了意图╮ 2020-12-21 04:20

After running this code:

#include 
int x;
int main(void)
{
    printf(\"%d\\n\",x);
    return 0;
}
int x=5; 

I expected t

3条回答
  •  眼角桃花
    2020-12-21 04:51

    The first acts as a forward declaration, and the later acts as the actual definition.

提交回复
热议问题