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 5.6 (9)
String FunctionsDominic Vonk 5.6 (9)
simple StopWatch with roundtrip timeNickMa 5.6 (9)
A portable card deck class with shufflingSlyMaelstrom C++ANSI5.6 (9)
A simple example of hashtableAli Nawkhas Murad C++ANSI5.5 (131)
A simple double linked list using OOP techniquesAli Nawkhas Murad C++ANSI5.5 (142)
Examples of dynamic multidimensional arraysAli Nawkhas Murad C++ANSI5.5 (119)
Distanceprog-bman C++ANSI5.5 (184)
Failproof xor (en/de)cryptionyzb3 CANSI5.5 (113)
Pascals Triangle Using Combination Function of IndicesSHINE AIYYAPPAN CANSI5.4 (121)
Useful string functionsyzb3 CANSI5.4 (132)
Macro to swap nibble of BYTET Sailesh C or C++ANSI5.4 (10)
Templated queue classAli Nawkhas Murad C++ANSI5.4 (112)
Simple integer binary search example source codeSyed Rafey Husain C or C++ANSI5.3 (6)
Integer subset generatortreenef C++ANSI5.3 (10)
using struct tm, time_t, and time to create a simple clockDieter Manstein CANSI5.3 (11)
Three Dimension Coordinate Systems ConverterAli Nawkhas Murad C++ANSI5.3 (106)
Word wrap functionSean Hubbard CANSI5.2 (110)
Find The Sum of Digits of a Given NumberSHINE AIYYAPPAN CANSI5.2 (57)
Calandar generator printing a full calendar for any yearJoe C++ANSI5.2 (70)
An example of simple priority queue using linked lists.Ali Nawkhas Murad C++ANSI5.1 (115)
Shorter version of gotoxyNedeljko CLinux5.1 (59)
Conversions between number systemsAli Nawkhas Murad C++ANSI5.1 (106)
Count number of bits in a numberNaren Bala C or C++ANSI5.1 (9)
Templated stack class Ali Nawkhas Murad C++ANSI5.0 (100)
The standard ASCII table generator.Ali Nawkhas Murad C++ANSI5.0 (100)
binary addition using stack in STLanmol C++ANSI4.9 (96)
Convert NTSTATUS code to Win32 errorIan Abbott C or C++Windows4.9 (95)
A singly linked list with a sentinel implementationyzb3 CANSI4.9 (21)
friend function exampleAli Nawkhas Murad C++ANSI4.7 (66)
Next 30
Previous 30

Add a snippet!