#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
 
char *my_strcpy(char *dest, char *src)
{
    assert(dest);
    assert(src);
    char *ret = dest;
    while ((*dest++ = *src++) )//连同‘\0’一起拷贝了
    {
        ;
    }
     
    /*while (*src)
    {
        *dest = *src;
        dest++;
        src++;
    }*/
    //原串为‘\0’时跳出,并未拷贝‘\0’,要赋值*dest = '\0'
    *dest = '\0';
    return ret;
    //自加有副作用,因此return dest 可能读到最后'\0'就不输出了
}