I am trying to create an array of strings in C using malloc. The number of strings that the array will hold can change at run time, but the length of the string
malloc
#define ID_LEN 5 char **orderedIds; int i; int variableNumberOfElements = 5; /* Hard coded here */ orderedIds = (char **)malloc(variableNumberOfElements * (ID_LEN + 1) * sizeof(char)); ..