[LC++]int versus unsigned int

Bill Rausch bill at numerical.com
Thu Sep 27 01:45:05 UTC 2001


At 4:44 PM +0200 9/26/01, Carlo Wood wrote:
>
>( unsigned int i = 0;
>   --i;
>   does NOT give a warning).



Yeah, I think this type of error in particular is a killer and 
negates much of the supposed type protection of using an unsigned int.

My default behavior is to use an int except when:
   a)  you need the extra large values
   b)  you are working with bit arrays or other packed data structures
   b)  you specifically need a short or long because of hardware or other issues


-- 
  Bill Rausch, Software Development, Unix, Mac, Windows
  Numerical Applications, Inc.  509-943-0861   bill at numerical.com



More information about the tuxCPProgramming mailing list