[C#][C++] BitArray class object

  • C#
  • Thread starter Silicon Waffle
  • Start date
  • Tags
    Class
  • #1
162
203
I am learning both languages for coming certified exams :D
I have a code line in C# like this

Code:
byte[] resource=...;
BitArray data=new BitArray(resource.ToArray());
I would like to do this in C++ (I am using dynamic_bitset of boost - don't know if this a bad choice)

Code:
std::vector<unsigned char>resource=...
boost::dynamic_bitset<> data(resource.begin(),resource.end());
I am not a fan of boost, have you any other ways to covert the above C# code into C++. bitset of C++ only allows specification of template bitset size at compile time.
 
Last edited by a moderator:

Suggested for: [C#][C++] BitArray class object

Replies
35
Views
2K
Replies
9
Views
719
Replies
13
Views
909
Replies
36
Views
1K
Replies
2
Views
485
Replies
36
Views
1K
Replies
14
Views
3K
Replies
4
Views
684
Back
Top