C++中全局变量的编译器初始化值

来源:互联网 发布:网络小胖结婚照 编辑:程序博客网 时间:2024/05/29 04:39

#include<iostream>
using namespace std;


char a[2][2];   //全局的char数组的元素编译器默认初始化为'/0'
bool test;     //全局的bool变量默认为false

int main(){
 
 cout<<(a[0][0]=='/0')<<endl;
 cout<<test<<endl;
 return 0;
}