According to the Berne Convention, an international treaty signed by most countries in the world, copyright applies to works automatically, with no notice needing to be given.
Under the Convention, copyrights for creative works are automatically in force upon their creation without being asserted or declared. An author need not "register" or "apply for" a copyright in countries adhering to the Convention. As soon as a work is "fixed", that is, written or recorded on some physical medium, its author is automatically entitled to all copyrights in the work and to any derivative works, unless and until the author explicitly disclaims them or until the copyright expires.
This means that no license to use the code is automatically granted by posting it in public, and copying and using that code in another work is illegal unless given explicit permission.
Of course, this is tempered by the notion of fair use, and whether the work was sufficiently creative to fall under copyright law. In general, something that is under 10 lines long, or is a demonstration of the only way to do something in a particular language that is widely known, will generally either not be copyrightable, or usage will most likely be permitted under the fair use doctrine. The problem with fair use is that you generally can't tell for sure if it's fair use until it's been taken to court, at which point you have already had to pay for lawyers, spend time in court, and so on. You will have to use your judgement to determine if using something constitutes "fair use"; and the 10 lines I mentioned is only a very rough guideline.
In sum, if there's something that's very short, not particularly creative, and the only way (or most obvious way) to do something in a given system, you can probably use it. If it's longer than 10 lines, or something creative like a code golf solution, or the DeCSS code (which may be under 10 lines but a lot of creativity and work went into crafting it, and it's generally not an obvious solution), then you should generally consider it to be copyrighted with all rights reserved and get permission before doing anything with it.
(note: I am not a lawyer, and this post does not constitute legal advice. For a better answer, I would recommend talking to a lawyer with experience in copyright.)