求字符串的长度(有效字符个数不包含’\0’) int Mystrlen(const char *str) { int count = 0; while(*str != '\0') { count++; str++; } return count; }