Re: How to know the size of array



void foo(int * array)



void foo(int *array, size_t len)


{


Now the array size is in `len`.

Thanx for the quick reply.

I think i read somewhere that i can get the size by:

(sizeof(array) ) / (sizeof(element))

in this case it will be

(sizeof(array)) / (sizeof(int))

I am not sure about this. Can we get the sizeof array to return the
size of all its elements.
Can sizeof find where the array is getting finished or it will just
give me the size of element.

Is there no way to get the size of array without passing the its
length.

Cheers
Vishal

.