if statement - Order of logical operations and resultant execution -


i thinking situation :

if( && b) {     dosomething(); } 

considering using c++, evaluated first ? a or b ?

and, let's imagine ais evaluated first, if a false, if statement try evaluate b before going out of if ?

is comportement same other programming languages ?

&& , || typically implemented short-circuit operators. if a false, b not need evaluated , (in languages) not be. a evaluated first , depending on value, b may or may not evaluated.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -