Assuming i, j, and k are all ints, explain what i != j < k means
belongs to book: C++ Primer|Stanley B.Lippman, Josee Lajoie, Barbara E.Moo|5th Edition| Chapter number:4| Question number:4.12
All Answers
total answers (1)
belongs to book: C++ Primer|Stanley B.Lippman, Josee Lajoie, Barbara E.Moo|5th Edition| Chapter number:4| Question number:4.12
total answers (1)
The expression `i != j < k` is the same with `i != (j < k)`.
First, `j < k` is evaluated and the result is a `bool`(either `true` or `false`).
Second, `i != true` or `i != false` is evaluated. Since `i` is an `int`, the `bool` will be converted to `int`, which means `i != 1` or `i != 0` is evaluated.