can any programmer debug this program. I am using this program to make a file(binary) and store some records in it. Code: #include<stdio.h> #include<stdlib.h> #include<string.h> main() { FILE *fp; char another,str[20]; struct customer { int accno; char c; float balance; }; struct customer e; clrscr(); gets(str); fp=fopen(str,"wb+"); if(fp==NULL) { puts("\nunable to open"); exit(1); } another='y'; while(another=='y') { printf("Enter accno.,name and balance:"); scanf("%d%c%f",&e.accno,&e.c,&e.balance); fwrite(&e,sizeof(e),1,fp); printf("Add another:"); fflush(stdin); another=getche(); } fclose(fp); } and then I try to display the records using this program... Code: #include<stdio.h> #include<stdlib.h> #include<string.h> main() { FILE *fp; char another,str[20]; struct customer { int accno; char c; float balance; }; struct customer e; clrscr(); gets(str); fp=fopen(str,"rb+"); if(fp==NULL) { puts("\nunable"); exit(1); } while(fread(&e,sizeof(e),1,fp)==1) printf("\n%d %c %f",e.accno,e.c,e.balance); fclose (fp); } but it displays e.accno and then displays some rubbish negative value for e.c and e.balance. Plz help me if you can.