wat does +++ do???

Go4Expert Member
17Nov2012,20:45   #1
IndiraP's Avatar
Code:
main() 
{ 
    int a=10,b=20,c; 
    c = a+++b; 
    printf("%d",c); 
}
output is 30..

how does this work???

Last edited by shabbir; 18Nov2012 at 10:32.. Reason: Code blocks
Go4Expert Founder
18Nov2012,10:32   #2
shabbir's Avatar
++ increments a and next + is an addition
Go4Expert Member
18Nov2012,16:14   #3
IndiraP's Avatar
Quote:
Originally Posted by shabbir View Post
++ increments a and next + is an addition
yes sir...forgot dat was a post increment..
so a+b n then a is incremented..
thank u sir..
Go4Expert Member
28Nov2012,16:58   #4
debugEnthu's Avatar
Just to add...
Maximum munch rule is follwed here.
ie: It uses
(a++ ) + b
instead of
a + (++b)
Go4Expert Member
12Dec2012,02:21   #5
IndiraP's Avatar
Quote:
Originally Posted by debugEnthu View Post
Just to add...
Maximum munch rule is follwed here.
ie: It uses
(a++ ) + b
instead of
a + (++b)
thank u for the info..