infinite for-loop and related question

Jason Mancini jayrusman@hotmail.com
Wed Feb 16 21:37:00 GMT 2011


> No. The C and C++ standards define that unsigned integers do not
> overflow, they wrap, with well-defined behaviour.

Aha, thank  you!

Though I still find the output of this odd:

  for (char i(1); i>0; ++i) 
    printf("%d %d\n", i, sizeof(i));

...
362195 1
362196 1
362197 1
...

For very large values of char!  ^_^

Jason

 		 	   		  



More information about the Gcc-help mailing list