We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I need some bits in bit segment;
so,how can declare a bit array,and how can i access it?
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!)
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.