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++ANSI8.3 (12)
This is Trigonometry Table made AlhamdulillahAbdul Haseeb Mir CWindows6.6 (5)
One line swap of integersabhilash C or C++ANSI8.1 (67)
This C code assigns codes to a maximum of 10 charsAbhishek H.Dwivedi C or C++Windows7.4 (5)
This C code recursively sorts an array of upto 20Abhishek H.Dwivedi C or C++ANSI5.7 (207)
This C code uses the merge sort algorithm to sortAbhishek H.Dwivedi C or C++ANSI6.3 (564)
Calculates the closest point to a segmentAdrián Deccico C or C++ANSI5.7 (132)
Find size and storage capacity of primitive data typesAli Murad C++ANSI8.4 (32)
Pascal's TriangleAli Murad C++ANSI8.5 (48)
Templated stack class Ali Murad C++ANSI8.9 (28)
Three Dimension Coordinate Systems ConverterAli Murad C++ANSI8.7 (6)
friend function exampleAli Murad C++ANSI6.2 (25)
The standard ASCII table generator.Ali Murad C++ANSI9.1 (28)
An example of simple priority queue using linked lists.Ali Murad C++ANSI8.1 (29)
A simple double linked list using OOP techniquesAli Murad C++ANSI7.6 (58)
Templated queue classAli Murad C++ANSI8.6 (36)
An example of Exception HandlingAli Murad C++ANSI8.9 (22)
Conversions between number systemsAli Murad C++ANSI8.3 (27)
Initial values for static multidimensional arrayAli Murad C or C++ANSI8.5 (33)
An example of using the same variable name in different scopesAli Murad C++ANSI8.5 (35)
Simple example for using thousand separator (,)Ali Murad C++ANSI8.4 (17)
A simple example of hashtableAli Murad C++ANSI8.1 (37)
Example of polymorphismAli Murad C++ANSI8.8 (38)
View the format of IEEE 754 floating point numbersAli Murad C++ANSI9.0 (35)
Examples of dynamic multidimensional arraysAli Murad C++ANSI8.7 (38)
An example of simple stack using linked lists.Ali Murad C++ANSI8.1 (27)
binary addition using stack in STLanmol C++ANSI8.7 (22)
Merge sort of an integer listBibhubrata Narendra C or C++ANSI5.1 (9)
Converts a real number to the string.Darko Kolakoviћ C or C++ANSI5.6 (237)
Validate Longitudinal Redundancy Checksum (LRC)Darko Kolaković C or C++ANSI5.8 (133)
Next 30

Add a snippet!