getting different outputs
Dec 7, 2011 at 11:47pm UTC
I get different characters thrown to the screen compared to whats written to the file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
vector<char >::iterator itc;
for (itc = codevector.begin(); itc < codevector.end() ; itc++)
{
char x = (*itc);
cout<<x;
}
ofstream myfile1;
myfile1.open ("output.txt" );
for (itc = codevector.begin(); itc < codevector.end() ; itc++)
{
char x = (*itc);
myfile1 << x;
}
myfile1.close();
the output written to the file is: µÇ
output written to DOS command line is something different
the codevector has random ASCII characters which were assigned to represent the compressed file in my Huffman algorithm.
Thanks
Dec 8, 2011 at 1:56am UTC
Would it be possible for you to post the entire code set. It looks like this may be in a main function... It would be helpful to see how codevector is populated...
Topic archived. No new replies allowed.