That won't work if the array was declared outside of the current scope (i.e. in another function, as only a pointer to the first element in the array will be passed).

So, you have a couple options:
1. Make sure you only use that method in the proper scope.
2. Keep track of this information in another variable.
3. Use a container such as std::vector.