Newsgroups: comp.lang.c++,comp.os.msdos.djgpp From: "A. Jans-Beken" Subject: How to program a set of bits? Content-Type: text/plain; charset=us-ascii Message-ID: <34462916.7762@oce.nl> Sender: news AT oce DOT nl (The Daily News @ nntp01.oce.nl) Content-Transfer-Encoding: 7bit Cc: jabe AT oce DOT nl Organization: Océ-Nederland B.V. Mime-Version: 1.0 Date: Thu, 16 Oct 1997 14:47:50 GMT Lines: 21 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In a program i'am writing I have a class like this: class PROPS { unsigned long set_of_32_bits; ... } Now I want to have an operator '[]' so I can program: PROPS flags; flags[2] = FALSE; flags[4] = flags[31] = TRUE; flags[6] = flags[3]; Please note that this is not the famous BITVECT example that can be found in many books about c++. I do not want to use a pointer to a bit set because the pointer takes up 4 bytes extra and i'am planning to use a huge array of PROPS (and related classes). please respond via e-mail thanx