![]() |
|
Technology Computing, programming, science, electronics, telecommunications, etc. |
|
Thread Tools | Display Modes |
![]() |
#8 |
I think this line's mostly filler.
Join Date: Jan 2003
Location: DC
Posts: 13,575
|
I think yours would return a valid password, but [edit]
Code:
bool passLength(string) // just print error, and return true/false. Don't read a new pw bool containDigit(string) // just print error, and return true/false. Don't read a new pw string getPW() { string pw = read line; while (( ! passlength(pw) ) || ( ! containDigit(pw) )) { pw = read line; } return pw; }
__________________
_________________ |...............| We live in the nick of times. | Len 17, Wid 3 | |_______________| [pics] Last edited by Happy Monkey; 11-22-2010 at 02:55 PM. Reason: logic error |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|