Archive for 1. November 2008

Inexplicably Working Errata

A few days ago, I received an email from a reader who reported a new errata on page 123 (in the “Learning to fly the PIC24″ book) in the write() function, an example of redirecting the “stdout” output stream.

The function receives a pointer to a buffer containing characters that need to be forwarded to the output device of choice and a counter. A loop is performed to print sequentially the required number of characters, but (here is the bug) I apparently omitted to increment the buffer pointer.  To the reader’s greatest surprise the code example seems to work anyway! How is this possible?

Read the rest of this entry »

|