C语言中strlen的几种写法 Num1: //用指针 int strlen(char *p) { char *q = p; while(*q != '\0') q++; retrun q - p; }