1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

wat does +++ do???

Discussion in 'C' started by IndiraP, Nov 17, 2012.

  1. IndiraP

    IndiraP New Member

    Code:
    main() 
    { 
        int a=10,b=20,c; 
        c = a+++b; 
        printf("%d",c); 
    }
    
    output is 30..

    how does this work???
     
    Last edited by a moderator: Nov 18, 2012
  2. shabbir

    shabbir Administrator Staff Member

    ++ increments a and next + is an addition
     
  3. IndiraP

    IndiraP New Member

    yes sir...forgot dat was a post increment..
    so a+b n then a is incremented..
    thank u sir..:)
     
  4. debugEnthu

    debugEnthu New Member

    Just to add...
    Maximum munch rule is follwed here.
    ie: It uses
    (a++ ) + b
    instead of
    a + (++b)
     
  5. IndiraP

    IndiraP New Member

    thank u for the info..:)
     

Share This Page