#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)); }
时间: 2024-10-02 00:44:22