DH> How does this work: " ?:"
It works just like a if{}else{}, sort of;
int iRnd = rand() % 100 + 1;
printf("iRnd is %s 50.\n",
(iRnd == 50)
? "equal to"
: (iRnd > 50)
? "greater than"
: "less than"
);
If the condition, expression or variable is nonzero, then
the first thing beyond the ? is selected. Otherwise, the
variable, expression, or function beyond the : is selected.
> ] Tagline!?! I thought suicide note! [ Jack Kevorkian ]...
---
---------------
* Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750)
|