More fun with Signed / Unsigned Comparisons
Here is why one should be very careful while mixing signed and unsigned integer comparisons. Take a look at this code snippet below: #include <iostream> #include <string> int main(int argc, char *argv[]) { std::string presidentsOrders = “NO lets do more sanctions”; unsigned int pos; pos = presidentsOrders.find(“YES”); if (pos != std::string::npos) { std::cout << “Lets … [Read more…]
