Re: [Dev-C++] using char* as bitfield
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: David M. <ci...@ya...> - 2003-09-29 12:19:24
|
Do you know how many bits you will need at compile time? If you then use a bitset. It is part of the STL. If you don't then you can use vector<bool> and hope your compiler vendor optimized it for space. Hope this helps David McKen ----- Original Message ----- From: "Christian Schäfer" <ca...@kr...> To: <dev...@li...> Sent: Monday, September 29, 2003 6:09 AM Subject: [Dev-C++] using char* as bitfield > hi dev-cpp-users, > > i want to allocate a string and then perform operations on its bits, > that I like to use as flags. > > but all the time such operation will give me an error on types.. > > expl: if(mystring & 0x0020) ... > > any thoughts? > > > gruss > /Christian mailto:ca...@kr... > > --- > > > I propose that the following character sequence for joke markers: > > :-) > > 19-Sep-82 11:44 Scott E Fahlman > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com |