You're a Java programmer, aren't you?
In C, arrays aren't aware of their length. The workarounds for this are:
1) Use a sentinel value to indicate where the array ends. This is the convention that's used for strings. Iterating through a null-terminated string is done with:
Code:
char* p;
for (p = str; *p != '\0'; ++p) {
/* do something */
}
2) For each array used as a function parameter, pass the array's length in another parameter. For example,
Code:
int main(int argc, char* argv[])