#include <stdio.h>
#include <string.h>
int main(void)
{
int i;
char a[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
for(i = 0; i < 10; i++)
a[i] = 0;
printf("%d\n",strlen(a));
}
strlen(a)=0
strlen遇到'\0' 就返回结束。
数组第一个a[0]=0---->相当于'\0' 因此直接返回