Is it important to declare a variable as unsigned if you know it should never be negative? Does it help prevent anything other than negative numbers being fed into a function th
One minor nicety is that it cuts down on the amount of array bounds checking testing that might be necessary... e.g. instead of having to write:
int idx = [...];
if ((idx >= 0)&&(idx < arrayLength)) printf("array value is %i\n", array[idx]);
you can just write:
unsigned int idx = [...];
if (idx < arrayLength) printf("array value is %i\n", array[idx]);