conditions in WHILE loop

in while loop like this

class A* a;
while (a && a->something1==something2) {body}

when a=NULL what is correct:
1) i get error because i cant get "a->something"
2) loop always check 1st condition and if it is true then check 2nd 3rd... so it will work propraly

Option 2) is the correct one.
'a' will be checked first. If it's not 0, other conditions are checked.
So, it is good to use it.
thx bro :)
Topic archived. No new replies allowed.