我的这段代码错在何处,求教大神!
#include <stdio.h>#define NAMESIZE 30
struct data{
float amount;
char fname[NAMESIZE];
char lname[NAMESIZE];
} rec;
int main(void)
{
printf("Enter the donor's first and last names,\n");
printf("separated by a space:");
scanf_s("%s %s", &rec.fname, &rec.lname);
printf("Enter the donation amount:");
scanf_s("%f", &rec.amount);
printf("\nDonor %s %s gave $%.2f.\n", rec.fname, rec.lname, rec.amount);
return 0;
}
[此贴子已经被作者于2016-9-7 17:26编辑过]