delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/12/10:51:21

X-Authentication-Warning: niemeyer.net: Host 200-230-186-188-as.acessonet.com.br [200.230.186.188] claimed to be computer
From: "Gustavo Niemeyer" <djgpp AT niemeyer DOT net>
To: <djgpp AT delorie DOT com>
Subject: RE: bits and flags
Date: Mon, 12 Jul 1999 11:49:53 -0300
Message-ID: <LOBBKLEPLBKLOKFELHOIMENJCDAA.djgpp@niemeyer.net>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
In-Reply-To: <35883781.8B19EC6B@go.ro>
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

>that's not true.
>to turn on bit #n :
>ch=ch|(1<<n)
>to turn off:
>ch=ch&(1<<n)
>where 0<=n<=7

Ops... that's not true also...

If you put ch=ch&(1<<n) you'll turn of all bits
BUT the desired one... so you have to do this to
turn off bit #n:

ch&=~(1<<n);


Gustavo Niemeyer
Niemeyer Network
High technology solutions
http://www.niemeyer.net

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019