#include <IOSTREAM>
#include <STRING> //如果声明string(字符串类型)那么要包含头文件#include<string>;在C中头文件时#include<CString>;
#include <IOMANIP> //输入输出流的头文件!,例如,使用setw(8),让每个数据输出时候占8列宽度!
using namespace std;
//二维数组的第一维的长度可以不指定,一维数组的长度可以不指定!
int main()
{
//字符串的定义和使用!
string str1 = "it's my name!";
string str2 = "and i am from China!";
string str3 = str1 + str2;
//字符数组和字符串数组的定义和使用!
char str[] = "i an happy!";
string arr_str[] = {"China","is","so","beautiful!"};
//各种输出效果!
cout<<"this is arr_str: "<<arr_str[0]<<" "<<arr_str[1]<<" "<<arr_str[2]<<" "<<arr_str[3]<<endl;
cout<<"this is char_arr: "<<str<<endl;
cout<<"this is string: "<<str1<<endl;
cout<<"str1 + str2 = "<<str3<<endl;
return 0;
}