•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 456,587 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,614 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 365 | Replies: 1
![]() |
This is where you input -1 in the second time:
cin.good() evaluates to true and the while loop exits.
Wouldn't it be better to do something like this?
(psuedo code)
•
•
•
•
cin >> dayOfWeek;
if (cin.good())
break;
cin.good() evaluates to true and the while loop exits.
Wouldn't it be better to do something like this?
(psuedo code)
tries = 3
while tries > 0
ask for day
if day is not >1 and <8
tries--
else
// print/return success
break
if tries is 0
// print/return failure Last edited by LaMouche : Nov 5th, 2007 at 3:02 am.
![]() |
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Square root program without sqrt or pwr (C++)
- IT project help (Pascal and Delphi)
- open a file and divide its data in arrays (C)
- C++ nest loop program - Help (C++)
- I don't know where is the question occured. (C)
- sorting parallel arrays (C)
Other Threads in the C++ Forum
- Previous Thread: help drawing triangles
- Next Thread: A simple text editor. How??!!


Linear Mode