Hi, so I'm having a strange problem right now when I'm initializing an array that is a double pointer. The line that is causing me problems is
lines->list = malloc(num_elements * sizeof(char *))
Lines is a struct, and list is a double pointer to a character. So
char **line
All I'm trying to do is initialize my double to hold num_elements in it. There are a couple of questions/problems I'm having when I run gdb and step to this line. One is, is sizeof(char *) supposed to be size 8? And also, when I look at the elements of list, list[0] is empty, list[1] and list[2] have something in it, and list[3] is invalid. This doesn't really make sense to me because num_elements evaluates to 2, so first only list[0] and list[1] should be valid.
Also, I'm not sure if this is useful information, but I've tried just putting actual numbers in for num_elements and sizeof(char *) and it still doesn't work.