I have the following attribute in my class

bool a [12];
bool b [100];
bool c [200];

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 please let me know how I can achieve that.


Looking at your example, it's not easy to imagine an alternative structure that would be more efficient and faster for processing than what you have.

If you had LARGE data sets that are sparsely populated, you could use a table with a 2 part key and a value. (Example: key = boola + index, value = 1 or 0)

==================================
MORE INFORMATION ON THIS TOPIC
==================================

Ask your Web development questions--or help out your peers by answering them--in our live discussion forums.

The Best Web Links: tips, tutorials and more.

Check out this live Q&A with Dave Slater and Jim Mason, How to best get started with WebSphere Development Tools.


This was first published in October 2002