Finding the length of an array

I want to make a variable specifically to hold the number of elements in an array, but the only way I can think of doing this is this:

1
2
int array[25];
int arraySize = array[...];


but when I print out the arraySize variable, I get some errors.
please help
size_t size=sizeof(array)/sizeof(*array)
that is just not making sense to me, no matter how hard I try to figure it out.

I want the variable to hold the number of elements, not the size of the array in bytes
Size of whole array / size of one element = number of elements
oh. ok thnx!
Topic archived. No new replies allowed.