문제

I nead to load a file ficture.txt,... run huffman and save it to a file so far I only have it working for textfiles. Can any one please tell me what function to use to load/save any data and convert it to bits/ from bits

도움이 되었습니까?

해결책

One byte at a time is the smallest amount one can read from a file.

So, you can read a byte at the time and store it an a char variable.

Then, you can extract the bits of the byte, by using bitwise operators << and >>.

Source

[EDIT]

Answering to the comment:

Read byte by byte from file in C++.

Also, you might want to take a look at the ifstream reference.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top