In VB, there is a UBound function which returns number of elements in an array.

How one can write similar function in C/C++?

The input should be an array and the function should return number of elements in the array.

Thanks in advance.