Multidimensional array on the heap - C
I am learning C and trying to make a function that would create an array of arrays of strings. #include <stdio.h> #include <stdlib.h> #include <string.h> void parse(char ***aoa) { char *string = calloc(9, sizeof(char)); //create a string of size 8+1 strcpy(string, "hi world"); // put text in that array char **array = calloc(10, sizeof(char *)); //create an array of strings aoa = calloc(10, sizeof(char *)); //create and array of arrays aoa[0] = array; //assign string array to the 0th elements of new array array[0] = string; //assign our string to 0th element of string carry printf("%s\n", aoa[0