I plan on answering a question with some source code on StackOverflow, but I have formulated my answer using some source code I found elsewhere — it was an answer to another question.
I planned on:
- Adding comments in the code linking to the question, and mentioning the original author, both at the function and function prototype (in C).
- Stating in my answer, that it included code from an answer to another question.
Does StackOverflow have any policies about using others' answers in your answers? Do I need to get the author's consent to re-use his code snippet as part of my larger source code answer? Does he make it public domain by posting it in the first place?
I tried the FAQ and searching this meta site, I couldn't find anything directly on topic.
FYI The reason why I don't want to simply "reference" his answer is because I would prefer my answer to simply be pasted into a text file and compiled.