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 (68)
Convert NTSTATUS code to Win32 errorIan Abbott C or C++Windows8.9 (47)
Three Dimension Coordinate Systems ConverterAli Nawkhas Murad C++ANSI8.9 (55)
Simple example for using thousand separator (,)Ali Nawkhas Murad C++ANSI8.9 (39)
Function pointer to member function of classselvam C++ANSI8.9 (15)
binary addition using stack in STLanmol C++ANSI8.8 (48)
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 (50)
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.6 (96)
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.4 (68)
Pascal's TriangleAli Nawkhas Murad C++ANSI8.3 (86)
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 (55)
Shorter version of gotoxyNedeljko CLinux8.0 (35)
Next 30

Add a snippet!