I noticed a few snippets recently where a size_t variable was used for array indices, and after searching around I'm still not sure what the obvious advantage of using a size_t variable over a typical int would be..
To clarify, what would be the difference between this:
for(size_t i=0;i<5;i++) //do something with arr[i]
for(int i=0;i<5;i++) //do something else with arr[i]
Is it worth using size_t variables in fairly generic, simple console apps etc or do it's advantages (if any) only become apparent at a much higher level of complexity..?
Not urgent, was just interested :)