Please tell me why my input and output are not the same in this code.
cents is always zero and the symbol is not defined!
Please tell me why my input and output are not the same in this code.
cents is always zero and the symbol is not defined!
It can't parse the separating dot. You need to read it into a dummy char.
By the way, you're using the pre-standard headers. See the FAQ for why you should use <iostream> instead of <iostream.h>, and what else you need to change as a consequence.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law