Suppose I have this (C++ or maybe C) code:
vector<int> my_vector;
for (int i = 0; i < my_vector.size(); i++) {
my_vector[i] = 0;
}
I don't care if it's done right. The important part is in the for-loop declaration.
The compiler gives a signed/unsigned mismatch for this, since size() returns an unsigned int, not a signed one. How important is it to change i
to unsigned? I declare loop counters as ints out of habit, but if this is a potential error I'll force myself to get out of the habit.