>I'm just saying that gets can find out, but it doesn't care to.
No, it can't.
>So, it would'nt work if I malloc a character array dynamically, for example?
char *foo(char *buffer)
printf("wrong size: %lu\n", (long unsigned)sizeof(buffer)/sizeof(*buffer));
printf("right size: %lu\n", (long unsigned)sizeof(line)/sizeof(*line));
/* my output
right size: 100
wrong size: 4
No, not there either.
>If the array was declared to be a 100 bytes at compile time as in your example, and you CAN use sizeof(buff) / sizeof(*buff) to reliably tell you the length than why would the pointer *p in your function be any different than buff?
Because an array is not a pointer.