Originally Posted by
matsp
There are several things not quite right.
1. You use fgets(buf, ...) then scanf - do you mean to use sscanf(buf, ...0?
2. exposure is an integer, %f is reading a float. Then you print it as a float again.
3. Your "clear the buffer out" seems to be in the wrong place - you should do that when someone has given the wrong result. But if you use fgets consistently, that shouldn't be necessary.
4. There is a ", buf" at the end of a printf, that I don't think should be there.
5. For the aperture comparison to have a chance of working, use 1.2f, 1.4f, ... 32.0f. This makes sure that the compiler doesn't expand the floating point number to double before comparing - this expansion can lead to the precision of the number being different between your aperture variable and the constant in the code, which in turn means that it's not equal.
6. You have several sets of unnecessary braces.
--
Mats