Actually sizeof() is behaving correctly... in the first line you asked it for the size of a pointer which it obediently returned.

If your function is working on arrays by pointer you will need...