Quote Originally Posted by wysota View Post
As for books and code within - you can't copy the code from a book into your project. You have to be sure you are not violating the copyright of the author of the code (which is probably the same as author or publisher of the book). The same as you can't reprint part of the text of the book, you can't reuse the code unless it's explicitely mentioned otherwise.
You are right, but the funny part about this one, is that if we consider all books ever written on programming, all written code is for sure in violation with the copyright of one book or another, as someone might just have written those three lines you just wrote....
(in theory even a simple "for (int i = 0;i < 10; i++)" might be a violation of a copyright, if you learned it from reading an example in a book that wrote the same line.

So I guess we all are copying code