TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: William Mcbrine
from: Bob Stout
date: 1998-08-16 17:59:58
subject: More silly questions

Again, the work's already been done and is available in SNIPPETS. In this
case, simply include the header BITOPS.H, then use the defined macros. For
example...

        int intPack;
        unsigned long ulPack;

        BitSet(intPack, 3);             /* Set bit #3 in an int         */
        BitClr(ulPack, 21);             /* Clear bit #21 in a long      */

...etc. There are also macros to test or toggle specific bits. If you need
a number of bits that won't fit in an integral type (int, short, char, or
long - signed or unsigned), then you can use a char array with other macros
in BITOPS.H, or you can create bit arrays of any arbitrary length using the
functions in BITARRAY.C. 


--- QM v1.00
* Origin: MicroFirm : Down to the C in chips (1:106/2000.6)
SEEN-BY: 396/1 622/419 632/371 633/260 267 270 371 634/397 635/506 728 810
SEEN-BY: 639/252 670/213 218
@PATH: 30883/6 106/2000 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.