Hey. How would I go about creating a 3D jagged array in C that's dynamically allocated? I've created a 2D dynamically allocated jagged array so I'm guessing it shouldn't be too different.
This is my thought process:
some_struct ***ptr;
int *size1 // keeps track of how many ptr[i]
int *size2 // keeps track of how many ptr[i][j]
Allocate memory for size1 and allocate memory for ptr based on some value (say 3)
for i 0 -> 5
Allocate memory for ptr[i]
Allocate memory for size2 (5)
for i 0 -> 5
for j 0 -> 4
Allocate memory for ptr[i][j]
... do stuff with ptr