Give a numeric expression that is valid in both C++ and Java, but
evaluates to different values.
Friday, September 12, 2008
Subscribe to:
Post Comments (Atom)
Programming tricks related to ActionScript, Python, C/C++ and Java. See the comments for answers.
1 comment:
The expression "(int) (char) 256" gives 0 in C++ (and C) because
char type is 8-bits and truncates 256 to 0, whereas it gives
256 in Java because char type is 16-bits
Post a Comment