hi,
I've completed huffman coding..but there is one small issue...in my decoded file the character "ÿ" keeps appearing at random places...I checked the problem and a second parse of the input file gives some characters that are not in my tree which ends up adding a code 0 of length 0 ...i dunno what that is...

Recommended Answers

All 6 Replies

With out seeing the code, it's a wild guess for us to.
But I bet that you break out of an array's bounds somewhere

I'm sorry..i mis read my files...its actually skipping a "ÿ" from the input files...and ÿ is not in my tree

How are you reading the files?
Because "ÿ" is char 255, which is the same (typically) as (char)EOF

That is, you reached the end of the file, but did not detect EOF properly, but instead cast it to a char.

How are you reading the files?
Because "ÿ" is char 255, which is the same (typically) as (char)EOF

That is, you reached the end of the file, but did not detect EOF properly, but instead cast it to a char.

I'm coding pdf files...and its appearing within the file...not at eof

yes...everything else is ok...only this character is being skipped

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.