📄 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 + -