Thanks for replies about code in books and copyright.
Now I have a new question.
Let's say I was interested in purchasing a piece of code from someone. There is a Non disclosure agreement attached to it. I presume it is to stop sharing of the code. However, I dont have the exact wording of the NDA. Now, let's say that I dont fully trust the competency of the coder I'm buying the code from and want a third party to check the code. Could I do this? Or would I be in trouble for breaking the NDA?