|
Whacky C Complier behavior
Beware! The compiler assumes constants are of type "char"
For example, this will generate no errors and give you -12 as the results!
int InitFoo = (100 * 5);
To get the right answer, you need to cast the 100 as an int:
int InitFoo = (int)100 * 5;
Sigh.
P.S. - floating point constants are completely screwed up. Not even casting seems to help.
Last edited by Larry Barello : 13-01-2004 at 00:51.
|