Pre and post increment

2009-07-20 Thread imap
Hello, Here is a program with output in gcc (4.3.2) on pre and post increments: //code begin #include main () { int a; a=1; printf ("1. %d %d\n", ++a, a); // 1. 2 2 a=1; printf ("2. %d %d\n", a, a++)

Re: Pre and post increment

2009-07-20 Thread imap
Hello Andrew, Thanks for your suggestion, but no difference in output. Question: Did you expect different output too? Thanks Quo ting Andrew Pinski : > On Mon, Jul 20, 2009 at 8:30 AM, wrote: > > Hello, > > > > Here is a program with output in gcc (4.3.2) on pre and post increments: > > Try

Re: Pre and post increment

2009-07-20 Thread imap
1. It is wise then to insure that the final value of an expression is ascertained upfront before it is being used in a function call as an argument. I suppose this is applicable in all cases of expressions and not limited to pre and post increments, although, pre and post is where there is likely