-7

I'm working on Huffman compression and ı need to write a file as a bit and it must include my bits in program.How can ı do this in c++ ?

By the way ı tried every solutions in the web and asked lots of form but ı couldnt fine anything

Stoler
  • 3
  • 1
  • 3
  • 1
    Have you tried anything? If not, do it straightforward: write the bits to some data type and then write it to a file. If it doesn't work, consult Stack Overflow. – cadaniluk Dec 30 '15 at 14:20
  • @cad No, if it doesn't work, _do some research_. Some _learning_. _Study it for a while_. Consult Stack Overflow as a last resort. – Lightness Races in Orbit Dec 30 '15 at 14:30
  • ı searched 2 days in a row and my english is not too good to understand everything about these.I tried to find something that ı can understand that's why ı ask here – Stoler Dec 30 '15 at 14:32
  • Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation. [Minimal, complete, verifiable example](http://stackoverflow.com/help/mcve) applies here. We cannot effectively help you until you post your code and accurately describe the problem. StackOverflow is not a coding or tutorial service. – Prune Jan 28 '16 at 19:59

1 Answers1

2

Blockwise: Append your bitsets to a buffer and write bytes, words or even larger portions from the buffer to the file. There is no bitwise file access in C++.

Have a look at bitset and this question.

Community
  • 1
  • 1
Kellerspeicher
  • 608
  • 4
  • 13