Encoding a String – Solution

The task for this month’s Exercise is to write an encoding filter that follows a specific pattern: After the first character (or byte) is output as a 2-digit hex value, the remaining characters are output as the difference between the previous character and the current character. I’m sure this type of encoding has an official name, but it’s the holidays and I’m too lazy to look it up.
Continue reading

Declaring Structures, Trick #3

Bitfields in a structure are weird, as I covered in last week’s Lesson. If you’re a nerd who appreciates bits and bit manipulation, you’re probably in love. These bitwise tricks are things the C language excels at. With a keen knowledge of bits, and a desire to use integer values beyond the standard widths, a nerd can have a lot of fun in C.
Continue reading