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.0 (66)
Convert NTSTATUS code to Win32 errorIan Abbott C or C++Windows8.9 (47)
Simple example for using thousand separator (,)Ali Nawkhas Murad C++ANSI8.9 (39)
Three Dimension Coordinate Systems ConverterAli Nawkhas Murad C++ANSI8.9 (54)
Function pointer to member function of classselvam C++ANSI8.9 (15)
binary addition using stack in STLanmol C++ANSI8.8 (47)
Templated stack class Ali Nawkhas Murad C++ANSI8.8 (52)
useful macros, functions and tricksyzb3 CANSI8.8 (47)
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)
Simple swapping heapsortyzb3 C or C++ANSI8.6 (76)
Templated queue classAli Nawkhas Murad C++ANSI8.6 (60)
Example of polymorphismAli Nawkhas Murad C++ANSI8.5 (94)
Examples of dynamic multidimensional arraysAli Nawkhas Murad C++ANSI8.5 (71)
Conversions between number systemsAli Nawkhas Murad C++ANSI8.5 (57)
Find size and storage capacity of primitive data typesAli Nawkhas Murad C++ANSI8.4 (54)
Word wrap functionSean Hubbard CANSI8.4 (61)
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)
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.2 (33)
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 (66)
A simple example of hashtableAli Nawkhas Murad C++ANSI8.1 (78)
ASCII table generatorAbdul Haseeb Mir C++ANSI8.0 (54)
An example of simple stack using linked lists.Ali Nawkhas Murad C++ANSI8.0 (65)
Next 30

Add a snippet!