bug? in turbo c++

Boyd Roberts boyd at necisa.ho.necisa.oz.au
Mon Mar 11 14:24:28 AEST 1991


In article <DDTO3BF at methan.chemie.fu-berlin.de> kirste at methan.chemie.fu-berlin.de (Burkhard Kirste) writes:
>Under UNIX, it doesn't matter: int = long = 32 bit (usually),
>although you have to specify %hd for short int (16 bit).

I can see you have vast experience on many UNIX machines.

Repeat after me:

    long and int are not the same

>Otherwise, if int = 16 bit, long = 32 bit, you have to use
>%ld for long. That is simply logical, not a "bug"!

No, %d for int, %ld for long.  It doesn't matter how many bits are involved,
the whole issue is to do with the _type_ of the arguments.  Use the right
format specifiers for the right types -- forget bits.


Boyd Roberts			boyd at necisa.ho.necisa.oz.au

``When the going gets wierd, the weird turn pro...''



More information about the Comp.lang.c mailing list