Hello all,
let me first lose some words to all the nice respons.
For example,
Jakob Bieling said:
'void main' is illegal. It is *always* 'int main'.
Ah yes?! and what does this change to the PROBLEM I described?
I think, you (and other who do this discussion) lose the focus.
No, but your boss could fire you for such C code, since it is invalid.
I would rather fire somebody who always loses the focus instead of such
really nonimportant points. BTW, I always use int main() as you
can see in my programms. But for this example it is absolutely
irrelevant.
Some people claim that the result I wrote is not correct at all.
Of course, it was "return x++" instead and forgot it in the
posting. Another point, that is not important to the problem at all.
You try to change a variable twice, which is invalid, ie. undefined
behaviour. Microsoft's compiler is absolutely right.
Ok, this is correct. I was of the opinion that such statements are
read from left to right. But it seems wrong, even most compilers
would do it like this. Ok, my fault, I learned it now (even
before reading all this flames.)
So thanks for the support.
Oliver