   [.net] C# expression evaluation
  Are standard C# compilers required to evaluate conditional expressions within an "if" from left to right?  For example, is it possible for the following code segment to throw a NullReferenceException (because of the .ToString() call)?object x = null;if ( (x != null) && (x.ToString() == "string") ) {// do something}   
  No, it's not possible.   ;  It has nothing to do with the if, and everything to do with the &&. The rules for short-circuiting && say that the left operand is evaluated first, and that if it evaluates to false the right operand is not evaluated.   ;  Thanks   