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)
This C code uses the merge sort algorithm to sortAbhishek H.Dwivedi C or C++ANSI5.5 (667)
This is Trigonometry Table made AlhamdulillahAbdul Haseeb Mir CWindows7.5 (290)
this one is better because a potential overflow (of the + operation) is avoided 8.6 (348)
Three Dimension Coordinate Systems ConverterAli Nawkhas Murad C++ANSI5.2 (107)
Three ways to do a swapDavid Nielsen C or C++ANSI5.6 (372)
Tic-TacToeptrs 8.6 (348)
useful macros, functions and tricksyzb3 CANSI5.0 (98)
Useful string functionsyzb3 CANSI5.6 (141)
using struct tm, time_t, and time to create a simple clockDieter Manstein CANSI5.6 (12)
Validate Longitudinal Redundancy Checksum (LRC)Darko Kolaković C or C++ANSI5.3 (165)
View the contents of a directoryfinnepower C++Windows5.5 (208)
View the format of IEEE 754 floating point numbersAli Nawkhas Murad C++ANSI7.5 (373)
Without semicolon print the statement.Jeevanrao 8.6 (348)
Without semicolon print the statement.Jeevanrao 8.6 (348)
Word wrap functionSean Hubbard CANSI5.4 (117)
xor (en/de)cryption using a key fileyzb3 CANSI5.0 (103)
Previous 30

Add a snippet!