C++字符串的连接实现

  • Post author:
  • Post category:其他


#include <iostream>
using namespace std;

void myStringLink(char* head, char* tail){
	while(*head) *head++;
	while(*head++ = *tail++);
}

int main(){
	char head[20] = "Hello ";
	char tail[10] = "World!"

	myStringLink(head, tail);
	cout << head << endl;
}



版权声明:本文为qq_40261882原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。