64,654
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
using namespace std;
static int a;
static int *p;
static char ch;
static float f;
static double d;
static long g;
static bool b;
int main()
{
cout<<"全局静态变量初始化值:\n";
cout<<"int "<<a<<endl;
cout<<"int "<<p<<endl;
cout<<"char "<<ch<<endl;//‘\0’初始化字符,但是输出来是不显示的
cout<<"float "<<f<<endl;
cout<<"double "<<d<<endl;
cout<<"long "<<g<<endl;
cout<<"bool "<<b<<endl;
return 0;
}