A division problem
bearophile
bearophileHUGS at lycos.com
Mon Mar 24 05:55:06 PDT 2014
Chris Williams:
> I also always write all my case/break statements as a set of
> matching pairs before writing any code in a switch, so the idea
> that something would fall through on accident seems like
> something that could never happen.
Now D catches most of such implicit case fall-through bugs.
> People should have habits like these (and putting constant
> values on the left side of a comparison),
void main() {
int x;
if (x = 5) {}
}
test.d(3,14): Error: assignment cannot be used as a condition,
perhaps == was meant?
Bye,
bearophile
More information about the Digitalmars-d
mailing list