情形1:
#include<stdio.h>
int main()
{
int arr_int1[10];
int arr_int2[]={1,2,3,4,5};
char arr_char1[10];
char arr_char2[]="world";
char arr_char3[]={'h','e','l','l','o'};
int i;
i=0;
while(arr_char2[i]!='\0'){
i++;
}
printf("%d\n",i);
i=0;
while(arr_char3[i]!='\0'){
i++;
}
printf("%d\n",i);
return 0;
}
情形2
#include<stdio.h>
int main()
{
char arr_char3[]={'h','e','l','l','o'};
int i;
i=0;
while(arr_char3[i]!='\0'){
i++;
}
printf("%d\n",i);
return 0;
}