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 (488)
simple StopWatch with roundtrip timeNickMa 7.4 (489)
Create a new file under linuxChol Nhial 7.4 (488)
Tic-TacToeptrs 7.4 (490)
Eventhandling macro for classesToolsDevler 7.4 (489)
Integer Partitions from 1 to NChristopher Brown 7.4 (490)
Menu driven program in c programmingcampus 7.4 (499)
Output console text with type-writer effect.Michael Brandon Miller 7.4 (490)
Palindrome FunctionJason Weeks 7.4 (486)
Quick-sort using vector and iterator in STLJianbao Tao 7.4 (488)
Word wrap functionSean Hubbard CANSI5.2 (160)
Simple linked list implementationyzb3 CANSI5.5 (137)
xor (en/de)cryption using a key fileyzb3 CANSI5.5 (116)
Creating, printing and free linked listsSyed Rafey Husain CANSI2.9 (35)
string to bitstring, bitstring to stringEsa Karjalainen CANSI4.8 (53)
Implementing a directory listing on LinuxJoshith C*nix4.1 (46)
Convert an integer into binary representationElabed Soufiane CANSI3.4 (43)
Singly linked list - insert, remove, add, countGirish Amara CANSI7.2 (1856)
Another merge sort of integer listManoj CANSI4.2 (46)
Failproof xor (en/de)cryptionyzb3 CANSI5.0 (151)
using struct tm, time_t, and time to create a simple clockDieter Manstein CANSI5.6 (12)
a simple clockrichmond caesar CANSI5.8 (696)
useful macros, functions and tricksyzb3 CANSI5.5 (115)
Dynamically Allocating a Multidimensional ArrayJared Hendrickson CANSI2.5 (35)
GotoXYStack Overflow C*nix5.7 (442)
dynamically create and initialise 4d arrayG.Watt.Porteous CANSI4.9 (97)
Find the Prime Factors of Given NumberSHINE AIYYAPPAN CANSI4.1 (51)
Find The Sum of Digits of a Given NumberSHINE AIYYAPPAN CANSI5.2 (59)
This is Trigonometry Table made AlhamdulillahAbdul Haseeb Mir CWindows6.4 (384)
Shorter version of gotoxyNedeljko CLinux5.1 (59)
Next 30

Add a snippet!