Mail Archives: djgpp/1999/01/29/14:05:03
Seawolf <seawolf AT net4you DOT co DOT at> wrote:
> Why does this code work with DJGPP but not with Borland C 3?
>
> int value = 0x000F;
> unsigned long c;
>
> c = value + (value<<8) + (value<<16) + (value<<24);
>
> DJGPP produces the correct 0x0F0F0F0F.
> But Borland C 3.1 only does the last two bytes: 0x00000F0F
Because ints are 32 bits in djgpp and 16 in BC (value is int so the
operations are made with ints, not long)
SET
------------------------------------ 0 --------------------------------
Visit my home page: http://welcome.to/SetSoft
or
http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013
- Raw text -