学习求助,运行错误,怎么修复
#include<stdio.h>#include<string.h>
#include<stdlib.h>
#define SIZE 20
int i=0;
FILE*fp;
struct account
{int id;
char name[10];
float balance;
}newone[SIZE];
int main(){
printf("请输入账号:");
scanf("%d",&newone[i].id);
printf("账户名:");
scanf("%s",&newone[i].name);
printf("账户余额:");
newone[i].balance=0.0;
scanf("%f",&newone[i].balance);
if(fopen("date.dat","wb")==NULL){
printf("cannot open file\n");
exit(0);
}
if(fwrite(&newone[i],sizeof(struct account)+1,1,fp)!=1)printf("write file orror\n");
fclose(fp);
i++;
}