I\'ve been struggling with this for days and I can\'t figure out why it doesn\'t work.
I\'m trying to read numbers from file with numbers written like this:
fscanf(reads,"%d %d %d %d %lf", n->id, n->sign, n->year, n->month, n->amount);
The scanf
family of functions expect addresses. Change the fscanf
line to:
fscanf(reads,"%d %d %d %d %lf", &n->id, &n->sign, &n->year,
&n->month, &n->amount);
Side note, this is a seriously misleading line:
else { while(!feof(reads)) {