Evaluation Order in a Condition statement

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?utf-8?Q?David_C=C3=B4me?=

    Evaluation Order in a Condition statement

    Hello.

    Let A and B be 2 boolean expressions.
    In the instruction if(A && B){/*..*/}, does the standard certify that A
    will be evaluated first ?

    Thanks a lot.
  • Christopher

    #2
    Re: Evaluation Order in a Condition statement

    On Mar 18, 3:32 pm, David Côme <davidc...@wana doo.frwrote:
    Hello.
    >
    Let A and B be 2 boolean expressions.
    In the instruction if(A && B){/*..*/}, does the standard certify that A
    will be evaluated first ?
    >
    Thanks a lot.
    left to right

    Comment

    • Paavo Helde

      #3
      Re: Evaluation Order in a Condition statement

      =?utf-8?Q?David_C=C3= B4me?= <davidcome@wana doo.frwrote in
      news:op.t78bb5k yrttu86@debian:
      Hello.
      >
      Let A and B be 2 boolean expressions.
      In the instruction if(A && B){/*..*/}, does the standard certify that A
      will be evaluated first ?
      Even more: if A yields false, B is not evaluated at all.

      Comment

      • Alexander Dong Back Kim

        #4
        Re: Evaluation Order in a Condition statement

        On Mar 19, 7:40 am, Christopher <cp...@austin.r r.comwrote:
        On Mar 18, 3:32 pm, David Côme <davidc...@wana doo.frwrote:
        >
        Hello.
        >
        Let A and B be 2 boolean expressions.
        In the instruction if(A && B){/*..*/}, does the standard certify that A
        will be evaluated first ?
        >
        Thanks a lot.
        >
        left to right
        This is absolutely right! Lazy evaluation!

        Cheers,

        Comment

        Working...