cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
limiitng float value
limiitng float value
Jan 21, 2012 at 6:24pm UTC
ddre20
(1)
i am writing a program that uses times but for times i am entering them as float values HH.MM
obviously the problem will come if cin a number like 15.75
what can i do to limit the decimal number to less than 59
Jan 21, 2012 at 7:11pm UTC
Peter87
(11254)
It is probably better to not use float for this because they are not always precise. Use integers instead.
Topic archived. No new replies allowed.