News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Shame Shame, a C question here !!!!

Started by donkey, November 12, 2006, 06:33:22 PM

Previous topic - Next topic

donkey

Hi,

I have a question about C header files, yes I know this is an assembly language forum so don't bother pointing it out. I am translating some header files and found the following ...

#define SO_LINGER  0x0080
.
.
.
#define SO_DONTLINGER  (int)(~SO_LINGER)

I have been working under the assumption that this would mean any value that does not have the SO_LINGER bit set, is this correct ?

Donkey
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

tofu-sensei

~ is the one's complement operator, therefore
(int)(~SO_LINGER) = 0xFFFFFF7F (assuming the compiler uses 32-bit integers)

btw, isn't this an assembly language forum?  :wink

Tedd

It's simply:

SO_DONTLINGER equ NOT SO_LINGER
No snowflake in an avalanche feels responsible.