i am implementing the huffman algorithm in C. i have got the basic functionality down upto the point where the binary codewords are obtained. so for example, abcd will be 100011000 ...
As a small experimental music piece I am attempting to program a song in standard C. The code outputs a raw PCM file which can be imported into Audacity. At the ...
(When you reply to a Usenet post, please quote enough context to make your reply meaningful as a stand-alone message. People don't always follow a discussion serially from its start, and someone whose first encounter with a thread is something like -- well, like what you've written below -- will have a hard time discovering what the topic is, and are ...
Hello, I am working on a compression project and I want to write ASCII characters using the minimum amount of bits. Since I will be writing ASCII characters from 0-127 I only need 7 bits to represent a character. Therefore, if I write each character at a time, I will end up writing 8 bits. One method would be to somehow ...
Hello, I'm writing a c program for class and it's asking me to write the low-order 8 bits of the time to the disk file. We are supposed to use the time system call and then write it to a file. Currently i have everything working doing this: unsigned char c; c = 0xae; write(fd, &c, 1); and to get the ...
I believe you cannot write just one bit (at a time) to a file (or buffer). You have to write at least one byte. So You should use those functions operate in bits (XOR, AND, SHIFT, etc). Check some RFCs implementation of that kind of algorythms (MD5, RIPEMD-160, SHA-1, CRC codes, and so on).
I don't believe there are actually any functions for writing single bits to a file. I believe the smallest value you can write to a file is byte-by-byte, and you would have to handle all of the XOR'ing, AND'ing, and whatnot yourself. But first things first, read up on fopen and fput.