Hello again!
Khalid El-Kary wrote:
> Hi,
> i'm a newbie asking about how can i count the number of elements in a
> non-string array? is this possible?
No, I suppose in C it is not possible. In C a "string" is considered a
non-string array, because it is an array of char-s (char[]). And every "string"
in C (a char[]) must be terminated with a '\0' character, which means that the
last element must be '\0', otherwise you don't know, where to stop.
So you need to store the number of elements in another variable, or you need a
special value, that will indicate the end of the array.
I think.
--
Regards
Balázs
|