mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2005-08-21, 04:19   #1
Citrix
 
Citrix's Avatar
 
Jun 2003

62E16 Posts
Default array of bits

How does one create a array of bits in C++?(msvisual C++)

Citrix
Citrix is offline   Reply With Quote
Old 2005-08-21, 09:07   #2
cjohnsto
 
Jun 2005

3·5 Posts
Default

If you want to use the STL than you can try using a bitvector. or a vector of bools. or an array of bools.
The best is bitvector since it is specifically designed for this and will probably use less memory. I think it is declared in the algorithm header file.

This is all from mem so forgive any compile errors oversights.

The last alternative is to do it yourself with bitmasks and intergers.
cjohnsto is offline   Reply With Quote
Old 2005-08-21, 20:06   #3
Citrix
 
Citrix's Avatar
 
Jun 2003

2·7·113 Posts
Default

Thanks
Citrix is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to init an array in Posix bc? ewmayer Linux 29 2018-03-08 21:42
Array vs Hash Table vs Map for QS Sam Kennedy Programming 1 2012-12-25 23:25
64 bits versus 32 bits Windows S485122 Software 2 2006-10-31 19:14
35-35.2 to 62 bits, cont from 61 bits Khemikal796 Lone Mersenne Hunters 12 2005-12-01 21:35
Ubasic Array question rn0dal Programming 6 2004-09-15 14:57

All times are UTC. The time now is 08:57.


Sat Jul 17 08:57:24 UTC 2021 up 50 days, 6:44, 1 user, load averages: 1.99, 1.59, 1.46

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.