You can minimize your calloc calls like so:
Code:
char **namelist;
// no need to use calloc here
namelist = malloc(numrows * sizeof *namelist);
// calloc all elements at the same time
namelist[0] = calloc(numrows * numcols, sizeof **namelist);
// assign rows to namelist elements
for (int i = 1; i < numrows; i++)
namelist[i] = namelist[0] + i * numcols;
However, if you can use a fixed array then you may as well:
Code:
#define NUMROWS 6
#define NUMCOLS 20
//...
char namelist[NUMROWS][NUMCOLS] = {{0}};;