Quote:
|
Originally Posted by Alan Anderson
Ooh, clever. Dangerous, but clever. It increments x unless it's already 100 or greater.
Code:
if (x < 100)
x = x + 1;
It's true, C does give you enough rope to shoot yourself in the foot.
|
Yes it does. I came up with this one myself... a very interesting mix of metaphors there. I would use the ++ but it's all semantic.
But there is absolutely no reason to do this. It doesn't save you any time, and it doesn't save you an space in memory. However, there is, and I kid you not, a contest to obfuscate code. This is a fairly simple example of that.
Paul Dennis