John wrote:
The following code:
-------------------------------------
#include <stdio.h>
This is a deprecated header. Use <cstdio>. Even better, use <iostream>.
int a=10
main()
{ printf("a=%d a++=%d ++a=%d \n",a, a++,++a);
return 0;
}
------------------------------------
This code won't compile. What do you mean by
int a = 10 main() { /*...*/}
?
When using gcc, the output is:
a=12 a++=10 ++a=12
When using VC++, the output is:
a=11 a++=11 ++a=11
The code won't compile in the first place. Throw away any compiler that
compiles such code.
-- --
Abstraction is selective ignorance.
-Andrew Koenig
-- --
.