The following is an infinite loop:
for (unsigned int i = 10; i < 0 ;--i) { printf("%d",i); }
The test part can never be false, because i can never become negative. This problem occurs more often, when the declation of i is farther from the loop.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment