首页 > 其他 > 详细

string::swap

时间:2020-01-17 10:02:33      阅读:83      评论:0      收藏:0      [点我收藏+]
void swap (string& x, string& y);

#include <iostream>
#include <string.h>

using namespace std;

int main()
{
string buyer("money");
string seller("goods");
cout << "buyer has " << buyer << endl;
cout << "seller has " << seller << endl;
swap(buyer, seller);
cout << "buyer has " << buyer << endl;
cout << "seller has " << seller << endl;
return 0;
}

string::swap

原文:https://www.cnblogs.com/xpylovely/p/12204255.html

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