C++入门经典-例6.4-输出字符数组中的内容

1:代码如下:

// 6.4.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include<iostream>
using namespace std;
void main()
{
    int i;
    char array[12]={'H','E','L','L','O',' ','W','O','R','L','D'};
    for(i=0;i<12;i++)
        cout<<array[i];
    cout << endl;
}
View Code

运行结果:

原文地址:https://www.cnblogs.com/lovemi93/p/7531326.html