

Ask HN: Am I doing anything illegal by publishing code from a book? - cvursache

Finally started going through K&#38;R C using a github repo to save source code from the book.
After an interesting chapter, I find it useful to implement the exercise and run it to get a better feel for the language. After publishing a few exercises on my public github repo, I realized that I may be breaking some copyright law. Googling around a bit didn't help. Maybe someone here on HN can help answer the question:<p><i>What is the policy on publishing source code from books? Is there a general answer to that question or does it differ with every book? Am I doing anything illegal or immoral by publishing code from a book on my github repo?</i>
======
benologist
There is probably an explicit copyright policy inside the book.

If there isn't you should assume you are violating their rights if you are
_publicly_ publishing their works and you would be better off using a private
repository.

