Hi,
consider the following code:
#define MAX_COUNT 4
static int foo(int w[MAX_COUNT])
{
int *p = w;
if (w) {
w[0] = 10; w[1] = 20; w[2] = 30; w[3] = 40;
}
return 0;
}
is it portable and legal pass NULL to above defined foo() (for example, for a situation when I don't need w[] be altered)? Given that the name of an array is a pointer to its first element, it seems to me that it should be OK, but perhpas I'm missing something?
Thanks !