8.字符串

2020-12-11  本文已影响0人  lxr_

#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;

}

上一篇 下一篇

猜你喜欢

热点阅读