Hi, I have an assignment that I'm going to end up needed to create multiple linked lists after reading a file.
For now I'm just trying to understand how that part works. I'm just taking each line of the file and storing trying to store in the next node of the linked list for concepts sake. (later I'll need to split each line up and do a lot more to it, but this is just to understand the concepts of linked lists.)
I'm getting an error of "assignment from incompatible pointer type". (lines 24, 29)
My question is what am I doing wrong on this?
struct node *next;
struct node *head = NULL, *temp;
/* opens file */
if ( (fp = fopen("dates.csv", "r" )) == NULL )
printf("Couldn't open file\n");
while(fgets(buffer, sizeof(buffer), fp))
temp = malloc( sizeof( struct node ) );
temp->next = head;
head = temp;
for(temp = head; temp != NULL; temp = temp->next)