[nycbug-talk] Re: MSNBC on the decline of technology jobs

Bob Ippolito bob
Wed Jun 22 22:11:46 EDT 2005


On Jun 22, 2005, at 9:41 PM, Jed Davis wrote:

> In article <Pine.LNX. 
> 4.44.0506221357230.11177-100000 at bawx.pilosoft.com>,
>  <alex at pilosoft.com> wrote:
>
>> C has a lot of "gotchas" - if you don't know them and can't recognize
>> them, you'll fail my interview. I like to give examples that'd make a
>> difference between signed int/unsigned int
>>
>
> /*
>  * This came up (in a much more complicated form)
>  * on the GCC list recently:
>  */
> signed int x = INT_MAX;
> unsigned int y = UINT_MAX;
> ++x; ++y;
> /* Now, what are the values of x and y? */

While that's theoretically CPU architecture dependent, in practice  
you should expect -(INT_MAX + 1) and 0 for that.  Less painful  
programming languages either give you some kind of overflow exception  
or they simply would have integer types with infinite extent because  
modular arithmetic isn't actually what you want most of the time.

-bob





More information about the talk mailing list