void get_account(FILE *fp)//搜索账号信息模块函数 { int accountnum; int key; char name[32]; float balance; int i =0,j; char buffer[BUFFERSIZE]; int len; cur_account = 0; fseek(fp,0,SEEK_SET); while(!feof(fp)) // 因为feof()最后会读2遍,所以最后curAccount多加了1 { fscanf(fp,"%d %d %s %f",&accountnum,&key,name,&balance); accountcollection[cur_account].account = accountnum; accountcollection[cur_account].key = key; strcpy(accountcollection[cur_account].name ,name); accountcollection[cur_account].balance = balance; cur_account++; } }