I have a 3d array of char pointers: char ***semicols
.
And I want the values to be something along the lines of
semicol[0][0] = "ls"
semicol[0][1] = "~"
semicol[1][0] = "man"
semicol[1][1] = "grep"
and so on. I have a char **args
array in which I have this stored, and I also know the number of semicolons in this array. I want to create smaller char** ARGS
which have the structure mentioned above, so semicol[0] = {"ls", "~"}
.
But I don't know the number of strings for each semicolon argument beforehand so I can't make it a static char *semicols[][]
. So how do I reasonably malloc for a 3d array, or is there a better way to do what I am attempting to do?