Skip to content

Commit 563cede

Browse files
committed
1 parent ba954aa commit 563cede

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ch06/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ more discusses: [#22](https://github.com/ReadingLab/Discussion-for-Cpp/issues/22
299299
300300
This loop let user input a word all the way until the word is sought.
301301
302-
It isn't a good use of assert. because if user begin to input a word, the `cin` would be always have content. so the `assert` would be always `true`. It is meaningless. using `assert(s == sought)` is more better.
302+
It isn't a good use of `assert`. The `assert` macro is often used to check for conditions that “cannot happen”. But the `assert` would always happen when users input `EOF` directly. The behavior is very natural, so the check is meaningless. using `assert(!cin || s == sought)` is more better.
303303
304304
## Exercise 6.49
305305

0 commit comments

Comments
 (0)