I'm currently using visual studio, if that makes a difference. I have a double array. I used the pause thing in there to keep track of what is exactly happening. I kept pausing it, keeping track of the value of loanBalance[0]. It is 1010.00 all the way up to the fprintf function.
the fprintf function looks like this.
fprintf(ofp, "%-3d (%11.2lf) %$%14.2lf %$%14.2lf %$%11.2lf", i, payments, principlePaid, interestPaid, loanBalance[0]);
This is how the loanBalance array is declared.
double loanBalance[SIZE];
Everything else prints out okay. It's just the loanBalance[0] that is printed out messed up. The value that prints out is like a huge number that has like 40 zeros, literally. I paused it even at the fprintf statement and looked at the value of loanBalance[0]. The first value is still a good 1010.00. I'm gonna assume it's the %lf part that's messing it up?
Aucun commentaire:
Enregistrer un commentaire