Sample C Code
The following C code performs a simple form of delta encoding and decoding:
void delta_encode (char *buffer, const unsigned int length) { char delta = 0; char original; unsigned int i; for (i = 0; i < length; ++i) { original = buffer; buffer -= delta; delta = original; } } void delta_decode (char *buffer, const unsigned int length) { char delta = 0; unsigned int i; for (i = 0; i < length; ++i) { buffer += delta; delta = buffer; } }Read more about this topic: Delta Encoding
Famous quotes containing the words sample and/or code:
“As a rule they will refuse even to sample a foreign dish, they regard such things as garlic and olive oil with disgust, life is unliveable to them unless they have tea and puddings.”
—George Orwell (19031950)
“...I had grown up in a world that was dominated by immature age. Not by vigorous immaturity, but by immaturity that was old and tired and prudent, that loved ritual and rubric, and was utterly wanting in curiosity about the new and the strange. Its era has passed away, and the world it made has crumbled around us. Its finest creation, a code of manners, has been ridiculed and discarded.”
—Ellen Glasgow (18731945)