You still haven't told us what book you're using.

> Ahh code from a book... check for the books site to see if there is any updated code... perhaps it is made for a older compiler.
This is some good advice: most C books worth anything have an errata list on the author's website. If you don't know the url, you can google the author's name and see what you find.