#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; }
时间: 2024-11-25 13:29:17