Originally Posted by
paradox814
actually many compilers (including mine) will let you do it, even though it is considered bad form.
I've never heard of a compiler that will insert expressions in like that. Maybe I'm just ignorant. But I certainly wouldn't want that, because although a statement like this:
if (myvar == 4 || 5) { ...
might translate into:
if (myvar == 4 || myvar == 5) { ...
I certainly don't want
if (myvar == 4 || myothervar) {...
to turn into
if (myvar == 4 || myvar == myothervar) {...
Because who's to say that I didn't want to see if
myvar is equal to 4
or myothervar is a nonzero value?
"Technological progress is like an axe in the hands of a pathological criminal."