美文网首页
8.字符串

8.字符串

作者: lxr_ | 来源:发表于2020-12-11 19:03 被阅读0次

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

    }

    相关文章

      网友评论

          本文标题:8.字符串

          本文链接:https://www.haomeiwen.com/subject/tadawktx.html