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

运行结果:

posted @ 2017-09-16 14:52  一串字符串  阅读(741)  评论(0编辑  收藏  举报