| | |
Military time error checking
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
Um, do you mean something like:
where minutes is already defined as the number of minutes you got from the user.
C++ Syntax (Toggle Plain Text)
if(minutes > 59) { //whatever error you want to come up, ex: cout << "Error: minutes entered was over 59"; }
where minutes is already defined as the number of minutes you got from the user.
I'm a student. If my statements seem too absolute, feel free to coat them with "In my opinion..." or "I believe...".
time as a whole in what format? as a string? separated by a colon?(e.g., 13:49) you don't need to ask the user for input twice (that might make things easier though) but you do need to somehow separate the hours and minutes values (either before our after you ask for the input)
I'm a student. If my statements seem too absolute, feel free to coat them with "In my opinion..." or "I believe...".
![]() |
Other Threads in the C++ Forum
- Previous Thread: Class function that returns a struct...
- Next Thread: do while loop help
Views: 436 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream image input int java lazy lib loop looping loops map math matrix memory multidimensional multiple newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





