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)
View the format of IEEE 754 floating point numbersAli Nawkhas Murad C++ANSI9.1 (64)
Three Dimension Coordinate Systems ConverterAli Nawkhas Murad C++ANSI9.0 (50)
Convert NTSTATUS code to Win32 errorIan Abbott C or C++Windows9.0 (46)
Simple example for using thousand separator (,)Ali Nawkhas Murad C++ANSI8.9 (39)
binary addition using stack in STLanmol C++ANSI8.8 (47)
Templated stack class Ali Nawkhas Murad C++ANSI8.8 (51)
Function pointer to member function of classselvam C++ANSI8.8 (14)
Examples of dynamic multidimensional arraysAli Nawkhas Murad C++ANSI8.8 (66)
useful macros, functions and tricksyzb3 CANSI8.7 (46)
Failproof xor (en/de)cryptionyzb3 CANSI8.7 (65)
The standard ASCII table generator.Ali Nawkhas Murad C++ANSI8.7 (51)
dynamically create and initialise 4d arrayG.Watt.Porteous CANSI8.7 (48)
xor (en/de)cryption using a key fileyzb3 CANSI8.7 (49)
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)
Example of polymorphismAli Nawkhas Murad C++ANSI8.5 (89)
Find size and storage capacity of primitive data typesAli Nawkhas Murad C++ANSI8.4 (54)
An example of Exception HandlingAli Nawkhas Murad C++ANSI8.4 (42)
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)
Pascals Triangle Using Combination Function of IndicesSHINE AIYYAPPAN CANSI8.3 (67)
Pascal's TriangleAli Nawkhas Murad C++ANSI8.3 (85)
Find The Sum of Digits of a Given NumberSHINE AIYYAPPAN CANSI8.1 (32)
This C code assigns codes to a maximum of 10 charsAbhishek H.Dwivedi C or C++Windows8.1 (9)
An example of simple priority queue using linked lists.Ali Nawkhas Murad C++ANSI8.1 (65)
A simple example of hashtableAli Nawkhas Murad C++ANSI8.0 (77)
ASCII table generatorAbdul Haseeb Mir C++ANSI8.0 (53)
An example of simple stack using linked lists.Ali Nawkhas Murad C++ANSI8.0 (64)
Next 30

Add a snippet!