strcat
函数原型:char* strcat (char*, const char*);
char *my_str_cat(char* p_des, const char* p_src)
{
if (NULL == p_des || NULL == p_src)
{
return p_des;
}
char *p_des_head = p_des;
while(*p_des)
{
p_des++;
}
while(*p_src)
{
*p_des = *p_src;
p_des++;
p_src++;
}
*p_des = '\0';
return p_des_head;
}
相关阅读
1 strcpy原型声明:extern char *strcpy(char* dest, const char *src);头文件:#include <string.h>功能:把从src地址开始且含有NULL