What is a "snippet" of source code?

A snippet is short, fulfills a particular task well, and doesn't require much extra code beyond the standard library or system dependent code. A snippet is not a complete program -- for that you can submit code to our source code repository, which is a better place for handle larger programs. Ideally, a snippet should be a section of code that you can snip out of a larger program and easily reuse in another program. To make snippets easy to use, it's best to encapsulate them in a function, class, or, potentially, as a framework for starting a new program. All snippets should as error-free as possible, but neither the original authors nor Cprogramming.com can guarantee perfect code!