首页 > 其他 > 详细

自考新教材--p52

时间:2019-12-02 20:07:17      阅读:73      评论:0      收藏:0      [点我收藏+]

源程序:

#include <iostream>

#include <string>

using namespace std;

int main()

{

string s1, s2;

s1 = "c++程序";

s2 = s1;

string s3;

cout << "s3=" << s3 << endl;

s3 = s1 + s2;

cout << s1 + s2 << endl;

cout << "s3=" << s3 << endl;

 

bool b = s1 < s3;

cout << "bool=" << b << endl;

char c = s1[2];

cout << "c=" << c << endl;

cout << s1[2] << endl;

char arrstr[] = "Hello";

s3 = s1 + arrstr;

cout << s3 << endl;

system("pause");

}

运行结果:

技术分享图片

自考新教材--p52

原文:https://www.cnblogs.com/duanqibo/p/11972629.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!