#include<iostream>
//#include<string> //vs2019使用string时可不加该头文件
using namespace std;
int main()
{
//1.C风格字符串
char str1[] = "Hello World";
cout << str1 << endl;
//2.C++风格字符串
string str2 = "Hello World";
cout << str2 << endl;
system("pause");
return 0;
}
网友评论