I need to convert an NSarray filled with NSStrings and return this c array to the function.
-(char**) getArray{
int count = [a_array count];
char** array = calloc(count, sizeof(char*));
for(int i = 0; i < count; i++)
{
array[i] = [[a_array objectAtIndex:i] UTF8String];
}
return array;
}
I have this code, but when should i free the memory if I'm returning stuff?