#include <stdio.h>
#include <string.h>
void main() {
    char *strcopy(char *target, char *source);
    char a[] = "hello world~";
    strcopy(a,"thanks!");
    printf("%s\n",a);
    getchar();

}
char *strcopy(char *target,char *source) {
    char *p = target;
    if (strlen(target) < strlen(source)) {
        return NULL;
    }
    while (*target++ = *source++) {
        if (*source == '\0') {
            break;
        }
    }
    *target = '\0';
    return p;
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2021-12-18
  • 2021-12-18
  • 2021-05-15
  • 2021-12-15
  • 2021-11-30
猜你喜欢
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-11
  • 2022-12-23
相关资源
相似解决方案