c++ 实现strcpy(),strlen()

char* strcpy(char *strDest,const char *strSrc)
{
    char *result=strDest;

    assert((strDest!=NULL)&&(strSrc!=NULL));
    while((*strDest++=*strSrc++)!='');
    
    return result;
}

int strlen(const char *str)
{
    int count=0;

    assert(str!=NULL);
    while(*str++!='')
        count++;

    return count;
}
 
原文地址:https://www.cnblogs.com/huangcongcong/p/4003429.html