|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Broken PBASIC 2.5 Complier? | Mike Yan | Programming | 12 | 01-02-2003 09:11 |
| Selecting Autonomous Behavior | Gobiner | Programming | 5 | 22-01-2003 09:44 |