I am developing iOS application, I have created 2d array of BOOL in my public interface in .h file like this
BOOL array[10][10];
Now in .m file in some function i want to redecalre it with some other size may be
array[20][20]
How can i do that?
if you use C array they are immutable, once you alloc an array of a fixed size you cannot change it.
I have posted a solution here on a possibile implementation for 2d arrays using subscription:
Objective-c syntax for 2d array instance variable
if you use C array you have to manage the memory yourself, so you can declare a pointer to a 2d array in the .h and alloc memory using new, free, realloc and copy if a bigger array is necessary. i dont suggest this approach.
The simple answer is that you cannot. For C-Arrays the only thing you can do short of creating a structure and its associated functions is the following:
I would suggest either using nested NSArrays or creating a structure and associated functions for manipulating that dynamically resized array.