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)
useful macros, functions and tricksyzb3 CANSI5.5 (113)
Find the Prime Factors of Given NumberSHINE AIYYAPPAN CANSI4.1 (51)
An example of simple stack using linked lists.Ali Nawkhas Murad C++ANSI7.0 (423)
Pascals Triangle Using Combination Function of IndicesSHINE AIYYAPPAN CANSI6.8 (456)
dynamically create and initialise 4d arrayG.Watt.Porteous CANSI4.9 (97)
ASCII table generatorAbdul Haseeb Mir C++ANSI7.1 (433)
Conversions between number systemsAli Nawkhas Murad C++ANSI5.7 (125)
Simple example for using thousand separator (,)Ali Nawkhas Murad C++ANSI4.6 (91)
binary addition using stack in STLanmol C++ANSI5.1 (100)
A singly linked list with a sentinel implementationyzb3 CANSI4.9 (21)
A simple example of hashtableAli Nawkhas Murad C++ANSI5.7 (143)
Useful string functionsyzb3 CANSI5.7 (143)
An example of simple priority queue using linked lists.Ali Nawkhas Murad C++ANSI5.2 (135)
A simple double linked list using OOP techniquesAli Nawkhas Murad C++ANSI5.8 (165)
The standard ASCII table generator.Ali Nawkhas Murad C++ANSI7.0 (398)
friend function exampleAli Nawkhas Murad C++ANSI7.2 (380)
Three Dimension Coordinate Systems ConverterAli Nawkhas Murad C++ANSI5.3 (108)
Templated stack class Ali Nawkhas Murad C++ANSI8.5 (780)
Find The Sum of Digits of a Given NumberSHINE AIYYAPPAN CANSI5.2 (59)
Three ways to do a swapDavid Nielsen C or C++ANSI5.6 (373)
Calculates the closest point to a segmentAdrián Deccico C or C++ANSI5.0 (158)
Rectangle Collision DetectionDavid Nielsen C or C++ANSI5.5 (200)
Permutation GeneratorTreenef C++ANSI5.8 (465)
Validate Longitudinal Redundancy Checksum (LRC)Darko Kolaković C or C++ANSI5.3 (166)
euler approximation methoderic mbakop C or C++ANSI5.5 (280)
a simple clockrichmond caesar CANSI5.8 (642)
Converts a real number to the string.Darko Kolakoviћ C or C++ANSI5.7 (241)
Count number of bits in a numberNaren Bala C or C++ANSI5.1 (9)
similar to gotoxy; minimal screen control for wyseMike Kinney C or C++ANSI5.1 (180)
This C code recursively sorts an array of upto 20Abhishek H.Dwivedi C or C++ANSI5.3 (236)
Next 30
Previous 30

Add a snippet!