Assuming you're working with an array, the technique sizeof(array)/sizeof(*array) is the usual technique.

If you're working with a pointer rather than an array (and that includes passing an array...