?? 14.cpp
字號:
// 14.cpp : Defines the entry point for the console application.
// 演示數組的初始化
#include "stdafx.h"
#include <iostream>
using namespace std;
enum {array_size = 6};
void watch(const int *x)
{ // 遍歷全部的數組元素
for (int i = 0; i < array_size; i++)
cout << " x[" << i << "] = " << x[i] ;
cout << endl;
}
void main()
{
int a[array_size] = {0};
int b[array_size] = {1};
int c[array_size] = {1,2,3};
int d[array_size];
//編譯器可能將告警:數組未初始化
watch(a);
watch(b);
watch(c);
watch(d);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -