您的位置:首页 > 编程语言 > C语言/C++

C++ 在尾部添加字符串(两种方法) |C++ 连接字符串

2013-04-13 19:54 316 查看
#include "stdafx.h"
#include "iostream"

#include <string>
using namespace std;

#include <ctype.h>

int _tmain(int argc, _TCHAR* argv[])
{
//std::cout<<"come here"<<std::endl;

//char s1[30] = "I love";
//char *s2 = "C++";
//stringcat(s1,s2);
//std::cout<<s1<<std::endl;

string a = "www.";
a.append("baidu");

cout<<a<<endl;

string b = ".";
b += "com";

cout<<b<<endl;

cout<<a.append(b)<<endl;

system("pause");
return 0;
}

//char *stringcat(char *source,const char *dest)
//{
//
//}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: