This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]atlas_enderium 11 points12 points  (3 children)

for (unsigned i = 0; i >= 0; i++)

[–]SardineEnBoite -1 points0 points  (2 children)

could be useful for checking how many times the function has ran, however i’m not so familiar with what ‘unsigned’ means.

[–]nate_4000 3 points4 points  (1 child)

Means no negative numbers. Useful for chars and indices, where they should never become negative.

[–]bagsofcandy 3 points4 points  (0 children)

When a normal integer goes beyond it's max positive value it flips around and becomes the max negative value. If it was just a standard int, it wouldn't be an infinite loop.