#define TERMMAX 100
typedef struct{
int coef;
int expon;
} poly;
poly term[TERMMAX];
int avail = 0;
#define TERMMAX 100
enter code here
int main()
{
int i;
FILE *fp = fopen("a.txt", "r");
while(fscanf(fp, "%d\t%d", &term[avail].coef, &term[avail].expon) != EOF)
avail++;
the fscanf part above works just fine but the following fscanf doesn't.
while(fscanf(fp, "%d\t%d", &term[avail].coef, &term[avail++].expon) != EOF)
;
Nothing is stored in term[].expon. Why?