Jump to content
xisto Community
Sign in to follow this  
kvarnerexpress

Storing Bit Values In A File

Recommended Posts

Hello All,I am developing a utility for zipping and unzipping a file using the Huffman Algorithm. The code is implemented using 'C' language. I have finished coding for generating the appropriate bit code values for each of the symbols present in file and my next objective is to store the bit code values in a seperate file. As you all are aware, the smallest data type that is supported by C is the character which is 1 byte. Please can anybody suggest me on how to store the bit values generated as codes in a file?Thanks.

Share this post


Link to post
Share on other sites

hi kvarnerexpress,How are u constructing the string in the first place... u can use & and | operator to create the string and simultaneously write it to a file stream by opening it in binary mode.Though I have not worked on C for over 2 years now... the solution should work.. If u r still unable to solve it, reply back and I will program and post the code here.. But do try it out first..Cheers.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.