You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
631 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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++;
}
}