// C5_2.cpp : Defines the entry point for the console application. // 陣列初始化的驗証 #include "stdafx.h" #include #include using namespace std; int main(int argc, char* argv[]) { float data[4] = { 1, 2, 3 }; //宣告陣列初始值 float datao [4]; cout << endl; cout << "data[4]" ; for(int i=0; i<4; i++) cout << setw(15) << data[i]; cout << endl; cout << "datao[4]" ; for(i=0; i<4; i++) cout << setw(15) << datao[i]; cout << endl; return 0; }