That completely depends on your data.
Assume you have a text file containing a number, a string and a double on each line:
Code:
1 alpha 1.23
2 beta 2.34
3 gamma 3.45
Now you need a node structure which is able to hold one line of data:
Code:
struct node
{
int number;
char[10] string;
double real_number;
struct node *next;
};
For reading the data you have several options: fscanf(), fgets() + sscanf(), fgets() + your own parsing, fgetc().
Using the combination fgets() + sscanf() you could write something like this in a loop (I'm omitting error checking for brevity, but don't do that in real code!):
Code:
struct node *temp = malloc(sizeof(*temp)); // you need a new node for each line
fgets(buffer, sizeof(buffer), file_pointer);
sscanf(buffer, "%d %9s %lf", &temp->number, temp->string, &temp->real_number);
temp->next = NULL;
Now "temp" contains the data for one line and you are able to insert it into your list.
Bye, Andreas