# include & ltstdio.h & gt
Invalid? Master ()
{
int? num[]={ 1,2,3 };
Charles? str[]={'4 ',' 5 ',' 6 ' };
for(int? I = 0; I< sizeof (num)/sizeof (int); I++)//sizeof(num)/sizeof(int) calculation length
{
printf("%d?" ,num[I]);
}
puts(" ");
for(I = 0; I< sizeof (str)/sizeof (char); i++)
{
printf("%c? ,str[I]);
}
puts(" ");
} If it is a string array, you can use str[i]! =0 to determine whether it reaches the tail, so there is no such thing as the number of elements.