I\'m trying to use fgets and strtok() to read in a file line by line, and create a linked list of each different line of information.
Right now, I\'m only just putt
strtok will modify the original string. Hence, previous pointers you stored are no longer there after each iteration.
strtok
Simple solution is to use: strdup to allocate and copy the values.
Just modify your assignment of value everywhere:
value
result[i][0] = value;
To:
result[i][2] = strdup(value);