Problem solve Get help with specific problems with your technologies, process and projects.

Can I pack Boolean arrays in C++?

I have the following attribute in my class:
bool a ;
bool b ;
bool c ;

All the attributes are Boolean arrays. I have to pack them to reduce space. Is it possible in C++? (I know it is possible in ADA.) If so, can you please let me know how I can achieve that?
In Visual C++ and Win32 development, these Boolean values will take up four bytes a piece. If you need to pack the data, you're much better off looking at a bit field representation.

Dig Deeper on C# programming language

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.