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)
Three Dimension Coordinate Systems ConverterAli Nawkhas Murad C++ANSI9.2 (46)
View the format of IEEE 754 floating point numbersAli Nawkhas Murad C++ANSI9.0 (63)
Convert NTSTATUS code to Win32 errorIan Abbott C or C++Windows8.9 (45)
Failproof xor (en/de)cryptionyzb3 CANSI8.9 (62)
Simple example for using thousand separator (,)Ali Nawkhas Murad C++ANSI8.8 (38)
dynamically create and initialise 4d arrayG.Watt.Porteous CANSI8.8 (45)
binary addition using stack in STLanmol C++ANSI8.8 (47)
xor (en/de)cryption using a key fileyzb3 CANSI8.8 (47)
Templated stack class Ali Nawkhas Murad C++ANSI8.8 (50)
Example of polymorphismAli Nawkhas Murad C++ANSI8.8 (81)
useful macros, functions and tricksyzb3 CANSI8.7 (45)
Examples of dynamic multidimensional arraysAli Nawkhas Murad C++ANSI8.7 (63)
The standard ASCII table generator.Ali Nawkhas Murad C++ANSI8.7 (51)
Function pointer to member function of classselvam C++ANSI8.6 (11)
Conversions between number systemsAli Nawkhas Murad C++ANSI8.6 (53)
Templated queue classAli Nawkhas Murad C++ANSI8.6 (60)
Simple swapping heapsortyzb3 C or C++ANSI8.6 (74)
An example of Exception HandlingAli Nawkhas Murad C++ANSI8.6 (41)
Find size and storage capacity of primitive data typesAli Nawkhas Murad C++ANSI8.6 (53)
Pascals Triangle Using Combination Function of IndicesSHINE AIYYAPPAN CANSI8.5 (63)
Initial values for static multidimensional arrayAli Nawkhas Murad C or C++ANSI8.4 (52)
Word wrap functionSean Hubbard CANSI8.4 (60)
An example of using the same variable name in different scopesAli Nawkhas Murad C++ANSI8.4 (53)
Pascal's TriangleAli Nawkhas Murad C++ANSI8.4 (81)
ASCII table generatorAbdul Haseeb Mir C++ANSI8.3 (49)
Find The Sum of Digits of a Given NumberSHINE AIYYAPPAN CANSI8.2 (28)
One line swap of integersabhilash C or C++ANSI8.2 (99)
An example of simple priority queue using linked lists.Ali Nawkhas Murad C++ANSI8.2 (60)
This C code assigns codes to a maximum of 10 charsAbhishek H.Dwivedi C or C++Windows8.1 (9)
A simple example of hashtableAli Nawkhas Murad C++ANSI8.0 (71)
Next 30

Add a snippet!