#include<stdio.h> #define STRLEN 100 char *mystrcat(char *dest,const char *src) { char *ret = dest; while(*dest != '\0') { dest++; } while(*dest++ = *src++) { ; } return ret; } int main() { char dest[STRLEN] = "andef"; char *src = "ghi"; printf("%s\n",mystrcat(dest,src)); return 0; }
原文地址:http://blog.csdn.net/zongyinhu/article/details/45033821