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)
String FunctionsDominic Vonk 8.1 (440)
simple StopWatch with roundtrip timeNickMa 8.1 (440)
Create a new file under linuxChol Nhial 8.1 (441)
Tic-TacToeptrs 8.1 (441)
Eventhandling macro for classesToolsDevler 8.1 (441)
Integer Partitions from 1 to NChristopher Brown 8.1 (441)
Menu driven program in c programmingcampus 8.1 (443)
Output console text with type-writer effect.Michael Brandon Miller 8.1 (441)
Palindrome FunctionJason Weeks 8.1 (440)
Quick-sort using vector and iterator in STLJianbao Tao 8.1 (440)
Word wrap functionSean Hubbard CANSI5.9 (137)
Simple linked list implementationyzb3 CANSI5.5 (137)
xor (en/de)cryption using a key fileyzb3 CANSI5.5 (116)
Creating, printing and free linked listsSyed Rafey Husain CANSI2.9 (35)
string to bitstring, bitstring to stringEsa Karjalainen CANSI4.8 (53)
Implementing a directory listing on LinuxJoshith C*nix4.1 (46)
Convert an integer into binary representationElabed Soufiane CANSI3.4 (43)
Singly linked list - insert, remove, add, countGirish Amara CANSI7.3 (1725)
Another merge sort of integer listManoj CANSI4.2 (46)
Failproof xor (en/de)cryptionyzb3 CANSI5.7 (127)
using struct tm, time_t, and time to create a simple clockDieter Manstein CANSI5.6 (12)
a simple clockrichmond caesar CANSI5.8 (642)
useful macros, functions and tricksyzb3 CANSI5.5 (113)
Dynamically Allocating a Multidimensional ArrayJared Hendrickson CANSI2.5 (35)
GotoXYStack Overflow C*nix5.9 (420)
dynamically create and initialise 4d arrayG.Watt.Porteous CANSI4.9 (97)
Find the Prime Factors of Given NumberSHINE AIYYAPPAN CANSI4.1 (51)
Find The Sum of Digits of a Given NumberSHINE AIYYAPPAN CANSI5.2 (59)
This is Trigonometry Table made AlhamdulillahAbdul Haseeb Mir CWindows7.1 (335)
Shorter version of gotoxyNedeljko CLinux5.1 (59)
Next 30

Add a snippet!