strange behavior of reverse loop in c# and c++ -
i programmed simple reverse loop this:
for (unsigned int = 50; >= 0; i--) printf("i = %d\n", i); but doesn't stop @ 0 expected goes down far negative values, why?
see ideone sample: http://ideone.com/kkixx8
(i tested in c# , c++)
you declared int unsigned. >= 0. reason see negative values printf call interprets signed (%d) instead of unsigned (%ud).
Comments
Post a Comment