Question: The desired result is to build 10 columns into NSArray. The following works with what looks like the desired result.  

But am I playing with fire here?

```
NSArray **ppp;

int m=10;

ppp = calloc(m, sizeof(NSArray));

ppp[0]=[[NSArray alloc] initWithObjects:
                 @"1",
                 @"2",
                 @"3",
                 ];

ppp[1]=[[NSArray alloc] initWithObjects:
            @"a1",
            @"b2",
            @"c3",
            @"d4",
            nil
            ];

NSLog(@"array test: %@   %@", [ppp[1] objectAtIndex:3], [ppp[0] objectAtIndex:2]);

```

thanks

Answer: 
You should, if you intend to, do 

```
ppp = calloc(m, sizeof(NSArray *));

```

but taking this path will involve manual memory management of the array of arrays. Why don't you use an `NSMutableArray` instance.

```
NSMutableArray * masterArray = [NSMutableArray array];
[masterArray addObject:[[NSArray alloc] initWithObjects:
                 @"1",
                 @"2",
                 @"3",
                 ]];

.....

NSLog(@"array test: %@ ", [[masterArray objectAtIndex:1] objectAtIndex:3]);

```
Your calloc is all wrong. If you want a buffer with 10 NSArray objects in it, do:

```
NSArray** ppp;
int m = 10;
ppp = calloc(m, sizeof(NSArray*));

```

...

The problem is that sizeof(int) != sizeof(id) on some architectures. You're short-sheeting yourself, you will smash your heap and you will hit a malloc exception when you have written past the end of your array. In addition, the error will be difficult to find.

I agree with InsertWittyName: just make an NSArray of NSArray's. It's easier and safer.