Objective-C initial values of created C-array
Posted
by kpower
on Stack Overflow
See other posts from Stack Overflow
or by kpower
Published on 2010-06-11T09:17:44Z
Indexed on
2010/06/11
9:22 UTC
Read the original article
Hit count: 410
I create an array, similar to classic C (not NSArray or one of it's children) - something like BOOL i[5];
. And I want to make all its values to be equal to NO.
First of all, I didn't found any information about initial values of such arrays (I know that in classic C they will be undefined, but don't know exactly about Objective-C. I found info about classes and its inner data [after allocation, without initialization], but not about simple data types).
And the second, if I should set array values manually - should I use memset(...);
or something different?
To prevent possible questions... I want to use this construction as array of temporary boolean flags and don't think that it is proved to use something like NSArray here.
© Stack Overflow or respective owner