Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
foo == 13如果为假,此代码是否具有明确定义的行为?
foo == 13
if (foo == 13 && ++bar > 42) { ... }
是的。如果第一个条件为假,则永远不会评估第二个条件。
请参阅避免执行第二个表达式的副作用。