For your first question, you can dynamically create an array using malloc() and use a pointer variable to store a reference to its first element. For example, this will create an array of 8 CGFloat s:
CGFloat *a = malloc(8 * sizeof a[0]);
If a not NULL, you can access a[0] through a[7] usual way. You can return this CGFloat * value to another function, and when you are done with the array, you must pass this value to free() .
In the second question, you can create an array of two pointers for two dynamic arrays:
CGFloat *a[2] = { NULL, NULL }; a[0] = malloc(8 * sizeof a[0][0]); a[1] = malloc(16 * sizeof a[1][0]);
Now you can access a[0][0] through a[0][7] and a[1][0] through a[1][15] (as long as a[0] and a[1] not NULL )
However, there is a wrinkle here: you cannot directly return arrays to C, so you can no longer return a from a function. Instead, you can use two levels of dynamic arrays, but it probably makes sense to store an array of pointers inside the holding object in the first place and pass a reference to this array to a function that fills it.
This means that your containing object will contain the CGFloat *a[2] field, and your function that allocates dynamic arrays and populates them will include the CFloat *dest[] parameter. This function will start with something like:
dest[0] = malloc(8 * sizeof dest[0][0]); dest[1] = malloc(16 * sizeof dest[1][0]);
... and then fill in the values ββas usual.
For the third question, the array created by malloc() will live until this pointer is passed to free() . As already mentioned, you can happily return this value and save it in another place if you are not free() until you are done with it.