Changes between Version 34 and Version 35 of ResumedC
- Timestamp:
- Jul 1, 2009, 6:55:07 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ResumedC
v34 v35 377 377 ,,Maybe this sounds strange by doing it this way but if ''var'' is equal to 0, then the result of the '''()''' is 1 (true), if you don't understand why is 1 or how this works, you need to start reading a new book of C again...,, 378 378 379 380 ==== The , Operator ==== 381 It can be used specially to include multiple operators, like in a for statement: 382 {{{ 383 #!C 384 for (two = 0, three = 0 ; two < 10 ; two +=2, three += 3) 385 }}} 386 387 ==== The ?: Construct ==== 388 It can be used like a replacement of ''if, else...'' but also specially to set values, like: 389 {{{ 390 #!C 391 amount_owed = (balance < 0) = 0 : balance; 392 #define min(x,y) ((x) < (y) ? (x) : (y)) 393 }}} 379 394 380 395