b++ is an operation on b or is it an evaluation of b

Discussion in 'Software' started by daudiam, Jan 1, 2010.

  1. daudiam

    daudiam

    Joined:
    Jan 1, 2010
    Messages:
    1
    Here is what I understood
    Code:
    c=a+b-c;
    In this, since ';' is the only sequence point here, the order in whuch a,b and c are evaluated is udefined, but the left associativity of + and - ensures that the OPERATION a+b happens before any other operation. Right ?

    Now in the following code :
    Code:
     a=++b/c*d;
    By the same reasoning, the order of evaluation of b,c and d should be undefined. But in the case of b, evaluating means PERFORMING AN OPERATION (pre-increment) also. Since, an operation is involved, the priority rules will apply. So here, the evaluation of b has to occur before that of c or d as the pre-increment has a higher priority than either * or /.

    So does it mean that in such cases, where pre and post increment operators are involved, the priority does decide at least some part of the order of evaluation of the expression (AS EVALUATING OPERANDS HERE INVOLVES AN OPERATION ON THEM, WHICH IS CONTROLLED BY PRIORITY AND ASSOCIATIVITY ?

    In essence, it boils down to :

    Is ++b treated as an operation on b or as an evaluation of b ?
     
    daudiam, Jan 1, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Silverstrand

    Nikao Dragonfire Case Evaluation

    Silverstrand, Nov 30, 2005, in forum: Front Page News
    Replies:
    0
    Views:
    721
    Silverstrand
    Nov 30, 2005
  2. Martin Schmid

    XP Evaluation CD?

    Martin Schmid, Jun 30, 2003, in forum: Microsoft Certification
    Replies:
    4
    Views:
    3,106
    Martin Schmid
    Jul 12, 2003
  3. Tanny

    Evaluation version win 2000 server

    Tanny, Apr 25, 2004, in forum: Microsoft Certification
    Replies:
    1
    Views:
    512
    peter walker
    Apr 26, 2004
  4. =?Utf-8?B?V2Vz?=

    Windows Server 2003 Evaluation Problem

    =?Utf-8?B?V2Vz?=, May 4, 2004, in forum: Microsoft Certification
    Replies:
    0
    Views:
    541
    =?Utf-8?B?V2Vz?=
    May 4, 2004
  5. Michael

    Evaluation version of sever 2003

    Michael, Jun 4, 2004, in forum: Microsoft Certification
    Replies:
    2
    Views:
    571
    Tom Helms [MSFT]
    Jun 4, 2004
Loading...

Share This Page