But if you declare the foo function before main, it works correctly regardless of where it's defined. The definition just has the effect of also declaring it, which is what makes the difference.
(Of course you know all this much better than I do, but someone younger reading this thread might be mystified.)
That wasn't the statement in the book, though. The thing is, this is a serious misfeature which isn't present in other languages, and can cause bizarre problems to the poor newbie user.
This order dependency is why C source code tends to be written bottom-up, rather than the more natural top-down.
(Of course you know all this much better than I do, but someone younger reading this thread might be mystified.)