C and C++ Source Code Snippets

Welcome to Cprogramming.com's programming code snippet repository. Peruse the archives or add your own snippets for others to use! (Check the following link a better definition of a snippet)

Sort by clicking on any of the headers.

SnippetAuthorLanguagePlatformRating (votes)
Menu driven program in c programmingcampus 5.3 (8)
Output console text with type-writer effect.Michael Brandon Miller 5.3 (8)
Integer Partitions from 1 to NChristopher Brown 5.3 (8)
Eventhandling macro for classesToolsDevler 5.3 (8)
code to shut a computer with windows XPbenn mutisya 5.3 (8)
Short program to print Hello World! without semicolonAli Nawkhas Murad 5.3 (8)
Tic-TacToeptrs 5.3 (8)
Create a new file under linuxChol Nhial 5.3 (8)
this one is better because a potential overflow (of the + operation) is avoided 5.3 (8)
Count number of bits in a numberNaren Bala C or C++ANSI5.1 (9)
A singly linked list with a sentinel implementationyzb3 CANSI4.9 (21)
Quick-sort using vector and iterator in STLJianbao Tao 4.7 (7)
Palindrome FunctionJason Weeks 4.7 (7)
String FunctionsDominic Vonk 4.7 (7)
String FunctionsDominic Vonk 4.7 (7)
simple StopWatch with roundtrip timeNickMa 4.7 (7)
Previous 30

Add a snippet!