#include <iostream>#include <string>using namespace std;int main() {// 1.C风格的字符串// 注意事项 char 字符串名[]// 注意事项 = 后面使用双引号包含char str[] = "hello world";cout << str << endl;// 2.C++风格字符串 需要引入头文件 #include <string>string str1 = "hello world C++";cout << str1 << endl;system("pause");return 0;}
