C and C++ Programming Tips

Welcome to Cprogramming.com's repository or tips for programming in C and C++. Peruse the archives or add your own tips for others to use!

Sort by clicking on any of the headers.

TipAuthorRating (votes)
assert() yourself!Kevin Lam 7.3
Do NOT always check for NULL! (C++)Kevin Lam 6.1
loop conditionKrishna 6.4
Pointer Memory allocationKrishnamoorthi 6.8
Use templates to prevent memory leakageKunal 5.6
Increment and decrement counters with rolloverLee Walker 2.3
backups using CVS save you lot of spaceLeif 6.2
Doing calculationsLinuxguru 5.5
One instruction per lineLudovic Flender 5.2
Keep fit to program betterLuna Man 6.8
logical error on divisionM.Kumaran 7.5
match the out side world ideas to logical designinmady 5.3
Use the Appropriate VariablesMahesh Kumar.S 5.5
clean up after cin (C++)Major_Small 6.5
Be careful of Magic behaviour due to compilers manik 5.9
Turn on all compiler warningsMaragato 5.8
Give Proper Names to Your VariablesMaragato 5.4
Determining if something was processed in a switch/case constructMarty Corbett 5.5
In C++ a pure abstract base class is a contractMarty Corbett 7.9
String to integerMayur Avhad 6.0
initalization of objectsmohit dhawan 6.5
Initialise all variables before useMounish 6.7
use of ! operatormrinal jha 6.2
Understanding the win32 data typesMuhammad Shahid 2.7
Dynamic memory allocation of 2d arraysnandam 3.5
Run code in Different compilersNaren Varma 6.0
Better coding style for comparisonnids 7.1
Comparisons in C\C++Nikitas Angelinas 7.3
Safely using strncpyoliv29 6.5
difference between int* p and int *p declarationomprakash mishra 7.0

Next 30
Previous 30

Help your fellow programmers! Add a tip!