| ■No83876 (VNM さん) に返信
The C++ Programming Language Second Edition の 3.3.1 章に以下のように書いてあります。
The operators && and || will not evaluate their second argument unless it is neccessary. For example:
if (p && 1<p->count) // ...
first tests that p is nonzero, and only if it is, tests 1<p->count.
そのあたりは C の時代から同じです。
質問者さんが使っているコンパイラがその通り実装されているかは分かりませんが。 |