|
|
|
|
|
by elbee
4647 days ago
|
|
On the other hand unsigned types are a huge pain if you want to iterate through an array backwards because you have to use subtraction. A lot of people end up with something like this: unsigned int i = strlen(s) - 1;
for (; i >= 0; --i) { // BUGBUG
if (s[i] == '.') {
break;
}
}
(Yes, you can make it work, but it is very error-prone when people try). |
|