I was wondering if its possible to insert multiple elements in a node of a doubly linked list in C. I need this to be able to read in a file with contents such as:
00:00 67.7
00:01 67.6
00:02 67.7
00:03 67.6
00:04 67.6
00:05 67.3
00:06 67.4
and copy the first 4 numbers as 2 integers and the third as a float. i was hoping to put those 3 in a node of a doubly linked list to later on be able to compare them to numbers in other nodes. i was thinking of something along the lines of this:
while (fscanf(ifp, "%d:%d %d.%d ", &hour, &min, &tempI, &tempD) != EOF) {
int dlist_ins_next(Dlist *list, DlistElmt *element1, *element2, *element3, const void *int1, *int2, *float);
}
Since you wanted the third as a float value, change your scan function to :
And you should be implementing the node as a structure :