Could anyone please explain the differences between
the following array passing? Thanks!
1) int get_data(char d[100]) {...}
2) int get_data(char *d) {...}
In (1), the function gets passed a pointer to an array of 100 chars. In
(2), the function gets passed a "generic" pointer to char.
I expected some differences in the compiler's treatment of the code, but a
test here shows none.
Which brings me to a related question... The following gives me no errorsor
warnings, even with warnings set to max. Shouldn't it at least warn me, if
not downright fail?
extern void foo(char array[100]);
void bar(void)
{
char array[50];
foo(array);
}
Also, this gives no warnings:
void foo(char array[100])
{
array++;
}
(Note that "array" is incremented by 1, not 100.)