huffman coding compression

Write your question here.
i'm working on buffman coding, but i don't understand much about it.
example :
i create a .txt file with content is "abc"
=> size of this file is 3 bytes
now assume character a have code is 10
b 01
c 00
then, i create another file that it's content is '100100'.
=> size of this file is 6 bytes
why size of second file bigger than first file.
anyone, help me to understand this problem.

Looks like there is some confusion here:
"100100" is a string of 6 characters.
I think you may have intended something like this:
1
2
3
4
5
6
7
    ofstream fout("output.dat", ios::binary);
    
    char a = 0x10;
    char b = 0x01;
    char c = 0x00;
    
    fout << a << b << c;

Topic archived. No new replies allowed.