MFC extension class CBitArray

Environment: Visual C++ 6, Windows 95/98/Me/NT/2000/XP

The class CBitArray behaves like a specialization of the MFC template class CArray. A real specialization is not possible because of a missing simple data type for a bit.

For maximum efficiency the bits are packed into a dynamic array of unsigned longs. You can easily modify the type of the date containing the bits (see typedef ULONG T in the declaration of CBitArray). CBitArray implements all member functions of the MFC class including the operator function [] (both for l-values and r-values).

The private member functions Copylr, Copyrl, and X are derived from the same-named functions of the class bitstring written by P.J. Plauger and are published with permission of the author.

Downloads

Download demo project - 23 Kb
Download source - 4 Kb


About the Author

Thomas Holte

Born in 1953 I'm a passionate programmer since 30 years. I'm employed as a software developer at a large company in Nuremberg, Germany. My hobbies are programming (what else) and digital photography.

Comments

  • Spitze!

    Posted by Legacy on 11/28/2001 12:00am

    Originally posted by: Catmad

    Hi!

    Vielen Dank f�r die CBitArray Klasse!
    Hab mich immerzu mit der bitset Template herumgeschlagen...

    Ciao
    Catmad

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

  • Mobile devices, social business apps, and business analytics are converging with the Cloud to create the most substantial changes in technology since the Internet revolution. Businesses have to change the way they think and operate, and with rising budgets for technology, they need someone to provide the services that will keep them competitive in this environment. Learn more about the important technology trends you need to stay on top of to ensure your business doesn't get left behind.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds