View Single Post
Old 10-16-2004, 01:23 PM   #9 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
Quote:
Originally posted by john_tran
Oh, I knew how LZW does, but i dont know how to write it in C++, because of bits as i mentioned.
what techs i do when i break bits. Such as :
Put 12 bit of a 12bit-number (A) and concatenate 4bit of the next 12bit-number (B) into 2 bytes and write it to file, and then put 8bit remaining of 12bit-number (B) and concatenate 8bit of the next 12bit-number (C) into 2 bytes and write it to file. After then, i continue put 4bit remaining of 12bit-number (C) and concatenate 12bit of the next 12bit-number (E) into 2 bytes and write it to file. So on, just repeat the loop if i want to add more.
But How i can do that in C++, what functions or technologies i have to learn?
Thanks for reply.
You have to learn the ways of shifting like Joe mentioned:
>> , <<
And masking might come in handy: &

I am not so good with this myself. Sorry.
__________________
Valmont is offline   Reply With Quote