
please wait
while (!valid)
and it works but logically that doesn't make sense to me, because valid is initialized as false and stays false until it is true, so wouldn't that statement be saying do while (valid is not false) ? That doesn't make sense, shouldn't it be do while (valid is false) ? Why does the logical not make it work? Thanks!
|
|
while ( cond )
repeats the loop as long as the cond is true. The loop breaks, then cond becomes false.std::string
for yes/no questions. How many mixed combinations of y, e, s, Y, E, S are there ? Should you test for them all?char
, then use either tolower
or toupper
functions to very simple logic. Have a look in the reference material at the top left of this page about those functions.