Would someone explain to me how to use these? I keep getting a segmentation fault on this line:
lines is a pointer array, storeline is a character string, l is the length of storeline, and my whole calloc expression is a pointer to space of the same size as storeline(at least that's what I'm going for).Code:strcpy(lines[e++] = calloc(l + 1, l + 1), storeline);
As I understand it right now, the first parameter of calloc is the number of elements in an array(storeline) and the second parameter is the number of bytes of the memory block which is the same since 1 char = 1 byte?
If someone would show me how to use these functions I'd really appreciate it. Thanks.