Is there a difference between "if" and "&&"? - page 2

 
helloea: You have a lot of knowledge.

Perhaps, you should read the documentation.

 
helloea:

You have a lot of knowledge.

Yeah don't be that humble, you're just starting, no doubt that after some practice you're gonna laugh at your old post :)

 
helloea:

You have a lot of knowledge.

No. I just Google 😂. 
 
Seng Joo Thio:

Before Build 600, both 'a' and 'b' are evaluated in 'if(a&&b)' regardless of 'a' being true or false - so if you have 'if(a>0 && b/a>4)', you'll crash when 'a'==0...

Oh, interesting to know. Luckily they got this fixed... even C had it right. https://en.wikipedia.org/wiki/Short-circuit_evaluation
Short-circuit evaluation - Wikipedia
Short-circuit evaluation - Wikipedia
  • en.wikipedia.org
Short-circuit evaluation, minimal evaluation, or McCarthy evaluation (after John McCarthy) is the semantics of some Boolean operators in some programming languages in which the second argument is executed or evaluated only if the first argument does not suffice to determine the value of the expression: when the first argument of the function...