I was wondering what kind of restrictions there are, if any, for code posted on StackOverflow?
In other words, I'm hoping StackOverflow has a clause that makes any posted code completely free of restrictions for reuse? (Both questions and answers).
Meta Stack Exchange is a question and answer site for meta-discussion of the Stack Exchange family of Q&A websites. It only takes a minute to sign up.
Sign up to join this communityRight down at the bottom of every page is "user contributions licensed under cc-wiki with attribution required".
"User contributions" links to questions-all, but I don't think "user contributions" is solely limited to questions. All code posted here is thus licensed under cc-wiki with attribution required.
Edit: If you click on any of the related links down the right side that seem relevant, you'll find that the copyright owner becomes Stack Overflow (or, I guess to be correct, Stack Exchange Inc.), and that's who you'd have to attribute. See also this question.
Edit 2: There's also this answer from Jeff Atwood, which may or may not clear things up for you.
No matter what the legal implications are, you should never use code samples found online.
You should always read the code, understand what it is doing, then close the browser tab and use that understanding to code.