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)
String FunctionsDominic Vonk 7.4 (493)
simple StopWatch with roundtrip timeNickMa 7.4 (495)
Create a new file under linuxChol Nhial 7.4 (497)
Tic-TacToeptrs 7.4 (495)
Eventhandling macro for classesToolsDevler 7.4 (494)
Integer Partitions from 1 to NChristopher Brown 7.4 (498)
Menu driven program in c programmingcampus 7.4 (518)
Output console text with type-writer effect.Michael Brandon Miller 7.4 (495)
Palindrome FunctionJason Weeks 7.4 (496)
Quick-sort using vector and iterator in STLJianbao Tao 7.4 (493)
Word wrap functionSean Hubbard CANSI5.2 (162)
Simple linked list implementationyzb3 CANSI5.4 (138)
xor (en/de)cryption using a key fileyzb3 CANSI5.5 (117)
Creating, printing and free linked listsSyed Rafey Husain CANSI2.9 (36)
string to bitstring, bitstring to stringEsa Karjalainen CANSI4.8 (54)
Implementing a directory listing on LinuxJoshith C*nix4.1 (47)
Convert an integer into binary representationElabed Soufiane CANSI3.3 (44)
Singly linked list - insert, remove, add, countGirish Amara CANSI7.2 (1976)
Another merge sort of integer listManoj CANSI4.1 (47)
Failproof xor (en/de)cryptionyzb3 CANSI5.0 (152)
using struct tm, time_t, and time to create a simple clockDieter Manstein CANSI5.2 (13)
a simple clockrichmond caesar CANSI5.9 (747)
useful macros, functions and tricksyzb3 CANSI5.5 (116)
Dynamically Allocating a Multidimensional ArrayJared Hendrickson CANSI2.4 (36)
GotoXYStack Overflow C*nix5.6 (443)
dynamically create and initialise 4d arrayG.Watt.Porteous CANSI4.9 (98)
Find the Prime Factors of Given NumberSHINE AIYYAPPAN CANSI4.0 (52)
Find The Sum of Digits of a Given NumberSHINE AIYYAPPAN CANSI5.1 (60)
This is Trigonometry Table made AlhamdulillahAbdul Haseeb Mir CWindows6.4 (390)
Shorter version of gotoxyNedeljko CLinux5.1 (60)
Next 30

Add a snippet!