Bitsets

This is a discussion on Bitsets within the C Programming forums, part of the General Programming Boards category; Hello, When working with bitsets, how should I be numerically refering to each bit in the set? Currently im doing ...

  1. #1
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459

    Bitsets

    Hello,

    When working with bitsets, how should I be numerically refering to each bit in the set?

    Currently im doing it as so:
    Code:
    //7654 3210 ..- bit numbering
     ....0010 0110
    Where, '7' is the 8th bit, and '0' is the first.

    Thanks in advanced... I know this isn't strictly C related but i've searched the internet to no avail.

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Just like arrays, your first bit is bit zero.


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ Bitsets
    By carrotcake1029 in forum C Programming
    Replies: 8
    Last Post: 06-10-2008, 02:01 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21