|
i tried it...n something seems to be written in the customer.txt file...
it looks something like this
"H’( ž@ 8@ ąż~x’( K@ PR ųR ’’’’p’( *v @ ųR ąż~ˆ’( ˜@ ”’( w6\v ąż~Ō’( rw ąż~ž32w ąż~ *’( ’’’’wš ģ’( Ew€@ ąż~ €@ ąż~ "
wats the problem here...
here is the code:
FILE *ofp;
for (i=0;i<5;i++)
{
printf("%d \n",acc[i].account_number);
printf("%s \n",&acc[i].account_type);
printf("%d \n",acc[i].balance);
}
ofp = fopen("customer.txt", "w");
fwrite(&acc[i], sizeof acc[i], 5, ofp);
fclose(ofp);
|