Java and Javascript have no relation. They are as said, two different languages. They both came out in 1995, but Java was developed by Sun Microsystems and Javascript was developed by Netscape. Javascript was influenced by Java, but outside of that the only other relation is the couple of paradigms they have in common.
sorry my mistake. i havent had to use ++ in a while where it mattered in which it was placed (so really only loop increments). and i thought it would be undefined, but when he said you could do that stuff i didnt question it
int C; //intentionaly uninitialized
int CC = C++ > C ? 0 : 1;
solve equation for CC.
Let's see (just for my clarification):
1 2 3 4 5 6
int C;
int CC;
if(C++ > C)
CC = 0;
else
CC = 1;
Error, wrong answer with possible segfault. We are using a comparison with whatever data is in the memory location for C which may not be the proper needed data.
5 Certain object representations need not represent a value of the object type. If the stored value of an object has such a representation and is read by an lvalue expression that does not have character type, the behavior is undefined. If such a representation is produced by a side effect that modifies all or any part of the object by an lvalue expression that does not have character type, the behavior is undefined.50) Such a representation is called a trap representation.
BHXSpecter, concerning your code, yes I imagine it might not pass compilation on the VC++ compiler, because it likes to initialize variables to values that have semantic meanings that will segment any unproper use, such as this incident. However, if my memory serves my correctly, the gcc compiler on Linux does not bother, so an uninitialized variable has REALL trash value and not initialized by compiler junk which I hate btw in the VC++ compilers