Re: How to know the size of array
- From: "manochavishal@xxxxxxxxx" <manochavishal@xxxxxxxxx>
- Date: 23 Mar 2006 02:25:03 -0800
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
.
- Follow-Ups:
- Re: How to know the size of array
- From: John Bode
- Re: How to know the size of array
- From: Vladimir S. Oka
- Re: How to know the size of array
- From: santosh
- Re: How to know the size of array
- From: Suman
- Re: How to know the size of array
- References:
- How to know the size of array
- From: manochavishal@xxxxxxxxx
- Re: How to know the size of array
- From: Vladimir S. Oka
- How to know the size of array
- Prev by Date: Re: How to know the size of array
- Next by Date: Re: array subscript type cannot be `char`?
- Previous by thread: Re: How to know the size of array
- Next by thread: Re: How to know the size of array
- Index(es):