不可思议404

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

#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);
}

posted on 2014-09-22 20:02  不可思议404  阅读(238)  评论(0编辑  收藏  举报