~$ 存档

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
#include "stdio.h"
#include "string.h"
char *str(char d[],char s[])
{
    char *p=d;;
    while(*p!='\0')p++;
    do
    {
        *p++=*s++;
    }while(*s!='\0');    
    *p=0;
    return d;
}
int main()
{
char d[20],s[20];
strcpy(d,"string ");
strcpy(s,"cat");
printf("%s\n",str(d,s));
}

 

posted on 2016-03-20 10:00  LuoTian  阅读(590)  评论(0编辑  收藏  举报