char * strcpy (char *strDes, const char *strSrc) { assert((strDes != NULL) && (strSrc != NULL) ); char *address = strDes; while((*strDes++ = *strSrc++) != ‘\0‘); //复制-包括‘\0‘ return address; }
int strlen(const char* str) { assert(str != NULL); int len = 0; while((*str++) != ‘\0‘) { len++; } return len; }
时间: 2024-10-06 01:20:34