getting different outputs

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
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.