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

  • #1
156
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:

Answers and Replies

  • #2
18,363
8,215
Thanks for the post! This is an automated courtesy bump. Sorry you aren't generating responses at the moment. Do you have any further information, come to any new conclusions or is it possible to reword the post?
 
  • Like
Likes Silicon Waffle

Related Threads on [C#][C++] BitArray class object

Replies
9
Views
2K
  • Last Post
Replies
3
Views
15K
  • Last Post
Replies
3
Views
19K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
23
Views
7K
Replies
35
Views
438
  • Last Post
Replies
9
Views
2K
Replies
4
Views
25K
Replies
14
Views
3K
Replies
8
Views
4K
Top