strcat()函数的实现

来源:互联网 发布:瑞文被削弱之前的数据 编辑:程序博客网 时间:2024/05/04 16:29
/** name:xif* coder:xifan2010@yahoo.cn* time:08.22.2012* function:char* my_strcat(char* pstr_1, char* pstr_2)*/char* my_strcat(char* pstr_1, char* pstr_2){char* Ret_address = NULL;Ret_pstr = pstr_1;/** 判断指针pstr_1和pstr_2是否为NULL*/if(pstr_1== NULL || pstr_2 == NULL){printf("Pinter is NULL\n");}/** 使指针pstr_1指向字符串实参的末尾,即末尾的NULL('\0')字符*/while(*pstr_1){pstr_1++;}/** 把参数字符串pstr_2拷贝到参数字符串pstr_1的末尾*/while(*pstr_1 = *pstr_2){pstr_1++;pstr_2++;}return Ret_address;}


原创粉丝点击