Explain what this loop does and whether it is a good use of assert
belongs to book: C++ Primer|Stanley B.Lippman, Josee Lajoie, Barbara E.Moo|5th Edition| Chapter number:6| Question number:48
All Answers
total answers (1)
belongs to book: C++ Primer|Stanley B.Lippman, Josee Lajoie, Barbara E.Moo|5th Edition| Chapter number:6| Question number:48
total answers (1)
The loop are used to keep reading string from the input until
`sought`
found. It is a bad idea to use`assert`
check whether`cin`
is in an error state. Because when the program compiled with`NDEBUG`
preprocessor variable, the statement would not be excuted.