Hi guys,

I've difficulties in developing a new link list by a loop


First of all, i let the user enter people's number: Numbger

And create an empty link list

And then read data to link list by for loop.
rec *f; //by using another pointer
f=p; //f indicates to the node which p indicates to
printf("OK1\n");//for my test
for(i=0;i<=Number-1;i++){
fscanf(fp1,"%s %s %s",&(f->Firstname),&(f->Lastname),&(f->Phonenumber));
f=f->Link;
}
//在嘗試用回圈 寫入number比資料入link list時發生了問題
//while I 'm using a loop to enter messages to nodes ,
//errors occur in the statement f=f->Link;
//But WHY?><"
//If i can'g use a loop , then what should i do ?
printf("OK2\n");

printf("%s\n",f->Firstname);
printf("%s\n",f->Lastname);
printf("%s\n",f->Phonenumber);
printf("%s\n",f->Link->Firstname);
printf("%s\n",f->Link->Lastname);
printf("%s\n",f->Link->Phonenumber);//for testing the date be written or not?


printf("OK3\n");



Thank you for your help >(_ _)<