I have a couple questions.
1) So, I understand that the Huffman compression method creates a binary tree depending on the number of occurrences/probability of a character (in my case). The higher the probability, the closer it is to the top of the tree. Each character in the tree is associated with a code, depending on its location in the tree, and this tree can be transformed into a table. Say, for example, you have this line being read from a file "AABC". So, I would count the frequency/probability of each letter and put it in a binary tree. So the table might look like:
[code]
A 2 010
B 1 000
C 1 1010
[code]
Here is where I'm a little confused.
When I output the compressed file it would look like:
But how is this compressed? There are more characters now than there was in the beginning. So, if I read in the "compressed" file, i would be reading in 13 characters instead of the original four.Code:010 010 000 1010
2) How come i can do:
but not:Code:char name[15] = "David";
Same here:Code:char name[15]; name = "David";
I want to be able to declare the char array by itself, and then assign it a value later on. It must be a char array of a fixed length.Code:class Person { public: string LastName; char FirstName [11]; Person(); }; I can do this with a string: person1.LastName = "David"; but not with the char: person1.Address = "29th";