首页 > 其他 > 详细

自己实现strcat函数的功能。(假如字符数组足够大)

时间:2014-09-22 20:14:04      阅读:339      评论:0      收藏:0      [点我收藏+]

#include <stdio.h>
#include <string.h>
/*
自己实现strcat函数的功能。(假如字符数组足够大)
*/

void main()
{
char str1[100] = "helloworld";
char str2[100] = "world";
int i = 0;
int index = strlen(str1);

for(i = 0; i <= strlen(str2); i++)
{
str1[index + i] = str2[i];
}

printf("%s\n",str1);
}

自己实现strcat函数的功能。(假如字符数组足够大)

原文:http://www.cnblogs.com/zhouyi404/p/3986630.html

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