Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Question about bit arrays and bit interpolation in C

Reply
Thread Tools

Question about bit arrays and bit interpolation in C

 
 
Pratap Das
Guest
Posts: n/a
 
      10-14-2003
Hi all,
Is there any concept of bit arrays and routines to manipulate them in
C?
Basically I need to form bit arrays of different sizes eg: 5 bits , 6
bits etc and then interpolate the bits of these arrays together to
form a big array...ie some kind of bit interleaving.
What is the most efficient way to do that in C? If I use uint8 etc
then eventually I am wasting some bits.
Thanks for all the help in advance.
--Das
 
Reply With Quote
 
 
 
 
Richard Heathfield
Guest
Posts: n/a
 
      10-14-2003
Pratap Das wrote:

> Hi all,
> Is there any concept of bit arrays and routines to manipulate them in
> C?


No, but it's trivial to invent and implement such a concept.

See http://www.snippets.org for some handy bit-hacking macros that work on
arrays of unsigned char. You should be able to fit CHAR_BIT bits into each
element of the array, thus wasting no space whatsoever.

--
Richard Heathfield : http://www.velocityreviews.com/forums/(E-Mail Removed)
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the point of having 16 bit colour if a computer monitor can only display 8 bit colour? How do you edit 16 bit colour when you can only see 8 bit? Scotius Digital Photography 6 07-13-2010 03:33 AM
Multidimensional arrays and arrays of arrays Philipp Java 21 01-20-2009 08:33 AM
64 bit - Windows Liberty 64bit, Windows Limited Edition 64 Bit, Microsoft SQL Server 2000 Developer Edition 64 Bit, IBM DB2 64 bit - new ! vvcd Computer Support 0 09-17-2004 08:15 PM
Last question ? This one on Interpolation Rez and Canon FS2710 Vs Epson 3200 FocaIPoint Digital Photography 9 01-03-2004 01:46 AM
64 bit - Windows Liberty 64bit, Windows Limited Edition 64 Bit,Microsoft SQL Server 2000 Developer Edition 64 Bit, IBM DB2 64 bit - new! Ionizer Computer Support 1 01-01-2004 07:27 PM



Advertisments