Ah, thanks. I didn't realize that you could split the decimal like that. It makes a lot more sense now.
And how would you do that with fgets()? I've been messing around with it for a little bit...
Type: Posts; User: generalt
Ah, thanks. I didn't realize that you could split the decimal like that. It makes a lot more sense now.
And how would you do that with fgets()? I've been messing around with it for a little bit...
But how would I read in $0.41 if I didn't read it in as a float?! I'm guessing double has the same problems.
So, if I only read in 2 decimal places that would solve the problem of imprecision? In this program, I don't think I'm in trouble w/imprecision b/c I convert it into an integer... right?
/*
CS50 Problem Set 2
This program asks for the user to specify how much change is due and then returns the smallest number of coins that could be combined to give the correct change. ...