Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
global_variable.c 328 Bytes
Copy Edit Raw Blame History
武小弟 authored 2021-04-09 18:29 . git add
/*
在程序中,局部变量和全局变量的名称可以相同,但是在
函数内,如果两个名字相同,会使用局部变量值,全局变量不会被使用。
#include <stdio.h>
/* 全局变量声明
int g;
int main()
{
/* 局部变量声明
int a, b;
/* 实际初始化
a = 10;
b = 20;
g = a + b;
printf("value of a = %d, b = %d and g = %d\n", a, b, g);
return 0;
}
*/
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化