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)
ASCII table generatorAbdul Haseeb Mir C++ANSI7.1 (433)
This is Trigonometry Table made AlhamdulillahAbdul Haseeb Mir CWindows7.1 (336)
One line swap of integersabhilash C or C++ANSI5.4 (199)
This C code uses the merge sort algorithm to sortAbhishek H.Dwivedi C or C++ANSI5.5 (668)
This C code assigns codes to a maximum of 10 charsAbhishek H.Dwivedi C or C++Windows3.1 (34)
This C code recursively sorts an array of upto 20Abhishek H.Dwivedi C or C++ANSI5.3 (236)
Calculates the closest point to a segmentAdrián Deccico C or C++ANSI5.0 (158)
An example of using the same variable name in different scopesAli Nawkhas Murad C++ANSI5.0 (103)
A simple double linked list using OOP techniquesAli Nawkhas Murad C++ANSI5.8 (165)
An example of simple stack using linked lists.Ali Nawkhas Murad C++ANSI7.0 (423)
An example of simple priority queue using linked lists.Ali Nawkhas Murad C++ANSI5.2 (135)
A simple example of hashtableAli Nawkhas Murad C++ANSI5.7 (143)
Simple example for using thousand separator (,)Ali Nawkhas Murad C++ANSI4.6 (91)
Pascal's TriangleAli Nawkhas Murad C++ANSI6.8 (474)
An example of Exception HandlingAli Nawkhas Murad C++ANSI4.6 (92)
The standard ASCII table generator.Ali Nawkhas Murad C++ANSI7.0 (398)
Initial values for static multidimensional arrayAli Nawkhas Murad C or C++ANSI4.9 (100)
Examples of dynamic multidimensional arraysAli Nawkhas Murad C++ANSI5.6 (127)
Find size and storage capacity of primitive data typesAli Nawkhas Murad C++ANSI5.3 (112)
Templated stack class Ali Nawkhas Murad C++ANSI8.5 (780)
friend function exampleAli Nawkhas Murad C++ANSI7.2 (380)
Templated queue classAli Nawkhas Murad C++ANSI5.6 (122)
Example of polymorphismAli Nawkhas Murad C++ANSI5.6 (202)
View the format of IEEE 754 floating point numbersAli Nawkhas Murad C++ANSI7.2 (417)
Three Dimension Coordinate Systems ConverterAli Nawkhas Murad C++ANSI5.3 (108)
Conversions between number systemsAli Nawkhas Murad C++ANSI5.7 (125)
binary addition using stack in STLanmol C++ANSI5.1 (100)
Merge sort of an integer listBibhubrata Narendra C or C++ANSI2.9 (37)
Create a new file under linuxChol Nhial 8.1 (441)
Integer Partitions from 1 to NChristopher Brown 8.1 (441)
Next 30

Add a snippet!