內置內型的對象,如果定義在file scope之內,必定被初始化爲0,但是如果他們被定義在local scope之內,那麼除非程序員指定其初值,否則不會被初始化。
在函數內必須初始化,否則會出錯。
#include<iostream>
using namespace std;
int a;
int main()
{
int ia;
cout<<"file scope ia="<<ia<<"\n";
cout<<"file scope a="<<a<<"\n";
}
筆記:單引號打印對應字符的ASC||碼,而雙引號打印對應的char字符。