delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/08/13:25:53

From: "Erik Johansson" <perikan AT 2 DOT sbbs DOT se>
Newsgroups: comp.os.msdos.djgpp
Subject: bits and flags
Date: Thu, 8 Jul 1999 18:39:52 +0200
Lines: 15
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: z5-2-15.sbbs2.net
Message-ID: <3784d701@193.13.199.3>
X-Trace: 8 Jul 1999 18:51:13 +0100, z5-2-15.sbbs2.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Lets say I have
char ch=1;

Now I can test if a bit is "on"
if(ch&1)
  .......

but how can I set a bit.. Lets say bit 4?
and how can I "turn off" a bit?

hope you understand my question...
thanx



- Raw text -


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