I have this code but the floats wont print to the file. Everything else prints and works well but the floats i see 0.000. Can someone tell me where im going wrong. I already declare them in the struct as float apaid; float tpaid;
customer customerinfo(customer info)
{
FILE *ci;
((ci=fopen("testing.txt","a+"))==NULL);
printf("Customer ID: ");
fflush(stdin);
scanf("%d",& info.cusid);
fprintf(ci,"\n\nCustomer ID: %8d\n",& info.cusid);
printf("Customer first name: ");
fflush(stdin);
gets(info.fname);
fprintf(ci,"Name: %s",& info.fname);
printf("Customer last name: ");
fflush(stdin);
gets(info.lname);
fprintf(ci," %s\n",& info.lname);
printf("Email ");
fflush(stdin);
gets(info.email);
fprintf(ci,"Email: %s\n",& info.email);
printf("Phone #: ");
gets(info.phone);
fprintf(ci,"Phone Number: %s\n",& info.phone);
printf("Amount paid to date ");
fflush(stdin);
scanf("%f",& info.apaid);
fprintf(ci,"Amount paid to date: %.2f\n",& info.apaid);
printf("Amount owed to date ");
fflush(stdin);
scanf("%f",& info.tpaid);
fprintf(ci,"Amount owed to date: %.2f\n",& info.tpaid);
return info;
fclose(ci);
}