I have a structure defined as such:
typedef struct {
int eqNo;
char eqName[20];
float price;
int stock;
int reorder;
} equipment;
and I capture the data for each field like this:
fflush(stdin);
gets(Equip.eqName);
fflush(stdin);
scanf("%f", &Equip.price);
fflush(stdin);
scanf("%d", &Equip.stock);
fflush(stdin);
scanf("%d", &Equip.reorder);
However, when I print out this information, the last field, reorder, prints out a long string of integers instead of the value actually placed in it. This only happens for some of the records.
Has anyone ever experienced this issue? If so, could you kindly enlighten me please? Thanks.