devc++ 中fscanf读取文件出现死循环乱码
```c
typedef struct Node{
int code;//商品代码
char name[50];//商品名称
int num; //总量
int price;//价格
int sold_num;//销售量
int remain_num;//库存量
int total;//销售额
struct Node *next;
}node;
```c
int readFile(Node *L){
FILE *fpr=fopen("Goods.txt","r");
node st;
node *s;
node *t=L;
if(fpr==NULL){
return 0;
}else{
//fcanf()
while(fscanf(fpr,"&d %s %d %d %d %d %d",&st.code,st.name,&st.num,&st.price,&st.sold_num,&st.remain_num,&st.total)!=EOF){
printf("&d %s %d %d %d %d %d\n",st.code,st.name,st.num,st.price,st.sold_num,st.remain_num,st.total);
s=(node *)malloc(sizeof(node));
*s=st;
t->next=s;
t=s;
t->next=NULL;
}
}
return 1;
}