C++基础学习系列--1、1的简陋版本--输入输出流与字符串变量的使用

#include 
#include      //如果声明string(字符串类型)那么要包含头文件#include;在C中头文件时#include;
#include     //输入输出流的头文件!,例如,使用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: "<

你可能感兴趣的:(C/C++)