I'm making a Huffman tree and I want to show the result of the message on the screen. Something like:
%pre%
But I have problems saving the numbers to print them in order of the message.
%pre%
The problem is that when I save the numbers I can only do it with vector < int & Number and that generates the outputs:
%pre%
When I want to save it in a string or char, so that:
%pre%
______ azszpr39118 ___
The problem, as you say, is that you are working with sequences instead of numbers. The digits to the left are significant and that a whole type does not support it. Hence, you can not group each sequence into a single index of the vector %code% .
One solution is to replace %code% so that it happens to store elementso of type %code% :
%pre%
Now, for each letter, we convert the Boolean sequence into a string:
%pre%
___