Why I Can't Stop For Loop In This Program? Because variable i
is declared as of unsigned char
type which ranges from 0
to 255
, so here
for(i=0;i<256;i++) { } /* 0,1,2..255, 0, 1 */
i
never reach 256
which results in infinite loop.
From limits.h
UCHAR_MAX 255