wat does +++ do???

IndiraP's Avatar, Join Date: Nov 2012
Go4Expert 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 shabbir; 18Nov2012 at 10:32.. Reason: Code blocks
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
++ increments a and next + is an addition
0
IndiraP's Avatar, Join Date: Nov 2012
Go4Expert Member
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..
0
debugEnthu's Avatar
Go4Expert Member
Just to add...
Maximum munch rule is follwed here.
ie: It uses
(a++ ) + b
instead of
a + (++b)
0
IndiraP's Avatar, Join Date: Nov 2012
Go4Expert Member
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..