hi,
How to create an instance of BitVector32 and initialize all to true? I read the MSDN but not totally answer my question.
Thanks,
POpskie
Printable View
hi,
How to create an instance of BitVector32 and initialize all to true? I read the MSDN but not totally answer my question.
Thanks,
POpskie
The BitVector32 only has two constructors. One takes a BitVector32 object, so that's obviously no use, and the other takes an int. If you want every Item in the BitVector32 to be true then you must specify an int that has every bit set. What int value is that?
Hi JM,Quote:
Originally Posted by jmcilhinney
I want all of this object initilialize to true. What is the syntax or how to create an instance tha initialize BitVect object all to true;
BitVect[0] // true;
BitVect[1] // true;
BitVect[2] // true;
BitVect[3] // true;
BitVect[4] // true;
BitVect[5] // true;
//etc.
thanks
Popskie
You already have the answer. :confused:
By doing one by one and assign to true.I think there is another way.Maybe passing an integer to the constructor but i dont know what the value to pass in order to assign to true. Maybe its one or zero or the lenght of the array you want to be true.
Its unsigned 0xffffffff which is signed -1 since the first bit is the sign bit.Quote:
Originally Posted by jmcilhinney
As per the last reply.
0 as a binary is 000...0000 - So in BitVector32 this would set all bits to false
1 as a binary is 000...0001 - Would set the 1st bit to true the rest to false
-1 as a binary is 111...1111 - Would set all bits to true