First off, fflush(stdin) is undefined. Flushing a stream is only valid for output streams, or update streams when the last operation was a write.
http://faq.cprogramming.com/cgi-bin/...&id=1043284351
As for your main question, the sizeof is applied to the parameter value (in this case, a pointer). The sizeof operator can't work out how much data a pointer points to (see example). Using [ ] instead of pointer notation in your function declaration doesn't change anything.
Eg.
Code:
void foo ( const char *a ) {
printf("%lu\n", sizeof(a) );
}
int main ( ) {
char a[] = "hello";
char b[] = "this is a longer string";
foo(a);
foo(b);
return 0;
}
Also see
http://c-faq.com/aryptr/aryparmsize.html