how to find upper bound of an array inside dll function

I have a dll that the user must pass a pointer to an array. I want to find the upper bound of the array but the following code returns the wrong number while inside the dll function:

double nPoints = static_cast<double>(sizeof(fitData))/static_cast<double>(sizeof(double));

I thought about letting user pass the number as an argument, but I would rather not do that as it would cause potentially not detected errors in the return values. Any idea how I can find the bounds of an array from a pointer to that array while inside my dll?

thanks in advance for any help.
Let the user pass a vector? There is no way to find out the size of an array anywhere else other than the point at which it was created.
thanks hanst99. I was afraid that was going to be the answer.
Topic archived. No new replies allowed.