|
-
Dec 15th, 2006, 02:07 AM
#1
Thread Starter
Fanatic Member
BitVector32
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
-
Dec 20th, 2006, 12:24 AM
#2
Re: BitVector32
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?
-
Dec 20th, 2006, 04:00 AM
#3
Thread Starter
Fanatic Member
Re: BitVector32
 Originally Posted by jmcilhinney
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,
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
-
Dec 20th, 2006, 04:18 AM
#4
Re: BitVector32
You already have the answer.
-
Dec 20th, 2006, 04:25 AM
#5
Thread Starter
Fanatic Member
Re: BitVector32
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.
-
Dec 20th, 2006, 04:32 AM
#6
Re: BitVector32
 Originally Posted by jmcilhinney
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?
Its unsigned 0xffffffff which is signed -1 since the first bit is the sign bit.
-
Aug 14th, 2008, 08:02 PM
#7
New Member
Re: BitVector32
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|