Advertisement

how to read & write bits on a file in C

Started by June 30, 2002 12:40 AM
1 comment, last by Buzz1982 22 years, 4 months ago
hi, i am making a compression program using huffman algo,for which i have to read and write on the file in the form of bits. stdio.h does not provide functions for reading and writing bits to a file. if any one knows the solution please reply(please explain in detail). also if someone knows a good site regarding huffman compression do refer it.
You cannot read or write to a file using bits for units. You must round up to bytes or something that can be composed of bytes (you can access the individual bits of a byte relatively easily using bitwise masking and shifting).

Advertisement
Cross-posts are evil!

/*=========================================*/
/* Chem0sh */
/* Lead Software Engineer & Tech Support */
/* http://www.eFaces.biz */
/*=========================================*/
/*=========================================// Chem0sh// Lead Software Engineer & Tech Support// http://www.eFaces.biz=========================================*/

This topic is closed to new replies.

Advertisement