摘要:
#include <iostream>using namespace std;int main(){ char ch1[10] = "ab"; char ch2[] = "abcdef"; strncat(ch1,ch2,3); //ababc 合并char类型的字符串,第三个参数是指需要合并的字符串个数 cout<<ch1<<endl; return 0;}//相对应的是string类的append成员函数的使用#include <iostream>#include <string>using 阅读全文
posted @ 2012-09-20 00:05
简单--生活
阅读(379)
评论(0)
推荐(0)
摘要:
#include <iostream>#include <string>using namespace std;int main(){ //char ch1[10] = "gh"; //char ch2[] = "abcdef"; //strncpy(ch1,ch2,6); //cout<<ch1<<endl; string str1="hello word"; //string str2="xianglingchuan"; //支持char字符串 //char st 阅读全文
posted @ 2012-09-20 00:05
简单--生活
阅读(236)
评论(0)
推荐(0)