|
From: Per W. <pw...@ia...> - 2008-04-01 05:42:35
|
No general way to find the size of an array. That is one of the reasons
for the STL container classes.
Anyway, if you can see the definition of the array, you can write:
#define NELEM(a) (sizeof(a)/sizeof(*(a)))
char arr[] = {"one","two","three"};
int arr_count = NELEM(arr);
/pwm
On Tue, 1 Apr 2008, Jan Mura wrote:
> Hello,
>
> I would like to ask if there is a possibility to get a dimesion of an arry.
> I have have got an array
> char arr[][] ={:one:, :two:, three:},
>
> And I would like to go thru the whole arry or several members. So shuld I
> store the value 3 like an number of members?
> Or can I to found it generally. Took a look to array definition but have not
> found anything.
>
> Thank you.
>
> Jan Mura
> jan...@vo...
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|