A number of years ago, I got a job teaching C programming. I'm a big believer in programming style and wanted a book that would teach good code writing practicies. I also wanted something that would teach my students how to debug programs.
Well, I couldn't find a book that contained what I wanted, so I wrote up lots of class notes.
After the class was over, I turned them into a book proposal. I decided to send them to O'Reilly and Associates. I figured you start with the best and when they turn you down, you try all the other publishers in town. Tim O'Reilly surprised me though by sending me a contract.
The result is Practical C Programming, now in it's third edition.