-
/**************************************************
-
* 程序名:test1.cpp
-
* 编辑者:鸿灬嗳
-
* 注:验证全局变量的改变。
-
***************************************************/
-
#include”iostream”
-
using namespace std;
-
int x=3;
-
void verify(void);
-
int main()
-
{
-
cout<<“查看初始化的全局变量x:“<<x<<endl;
-
static int y=2;
-
cout<<“定义静态局部变量y:“<<y<<endl;
-
cout<<“进行x+=y计算!“<<endl;
-
x+=y;
-
verify();
-
return 0;
-
}
-
void verify(void)
-
{
-
cout<<“查看是否改变全局变量x:“<<x<<endl;
-
}
本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。
ctvol管理联系方式QQ:251552304
本文章地址:https://www.ctvol.com/c-cdevelopment/604725.html