4 ms·
So signeds are better because they overflow differently? If you program C like there's no overflow, it doesn't matter much whether you mis-index the next array
by limmeau 13y ago
So signeds are better because they overflow differently?
If you program C like there's no overflow, it doesn't matter much whether you mis-index the next array with 4294967295 or -1. There's no substitute for overflow-vigilance, and particularly not rules like "such-and-such type is bad and such-and-such type is better".
(BTW: an ex-boss of mine claimed that signed ints were evil because because and insisted on using unsigned for everything, but that's a different story, and I'm glad he's an ex-boss)
- oleganza 13y agoOP means to say that when dealing with small enough numbers, unsigned integer may overflow, while the signed one won't. With huge numbers they both overflow, but we usually don't have them.
- guerrilla 13y agoSeriously. This seems totally basic to me. If someone wants to program in C, vigilance for case coverage of any kind is essential.