This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how can i do it

I need some bits in bit segment;

so,how can declare a bit array,and how can i access it?

Parents
  • And, if you don't what to do it in Standard 'C' (as you will find in "any 'C' book"), then you are going to have to study the Manual for the specific compiler that you are using - to find out what (if any) proprietary features it provides to do that.

    If you want suggestions on where to find the appropriate Manual, then you are going to have to say what specific compiler you are using!
    (but, as previously noted, it is folly to even start using a tool when you don't even know where the manual is!)

Reply
  • And, if you don't what to do it in Standard 'C' (as you will find in "any 'C' book"), then you are going to have to study the Manual for the specific compiler that you are using - to find out what (if any) proprietary features it provides to do that.

    If you want suggestions on where to find the appropriate Manual, then you are going to have to say what specific compiler you are using!
    (but, as previously noted, it is folly to even start using a tool when you don't even know where the manual is!)

Children
  • When looking for support for bit arrays, I think you should probably start by looking at the manuals for the processor. Does your current processor support any instructions for indexed addressing of bits?

    If the processor can't support something linke

    my_bits[idx] = 1;
    


    Then your compiler will also have a problem to produce code for such a feature, in which case you may have to settle for a different solution, such as masking bits in bytes.

    In this case, you did post a generic question without mentioning any toolset or processor, so I can only deduce that you are not really interested in any answers.