3 ms·
In C/C++, unsigned ints can result in a few very subtle bugs--more details here: http://stackoverflow.com/a/1555186/67591 http://stackoverflow.com/a/1555186/67
by IvyMike 12y ago
In C/C++, unsigned ints can result in a few very subtle bugs--more details here:
http://stackoverflow.com/a/1555186/67591 http://stackoverflow.com/a/1555186/67591
TL;DR: Google's C++ coding standard says: "Document that a variable is non-negative using assertions. Don't use an unsigned type."
As someone who has written a lot of C++ code to interact with hardware: I view an unsigned as a bucket of bits, and a signed as a number.