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)
Use Good Variable And Function Namesprog-bman 6.1
Error handling for newUpesh Jindal 6.1
Use makefilecjediknight 6.1
Fastest raise to power.Ezzetabi 6.1
gets() is bad.Sean 6.0
Run code in Different compilersNaren Varma 6.0
Test pieces of your code earlyHardi Pertel 6.0
One instruction per lineLudovic Flender 6.0
Make backupsVox 6.0
Reuse Old CodeTimofei Gerasimov 6.0
Pointer arithmetic trickinessvishesh jain 6.0
Always check for NULL (in C)Webmaster 6.0
Executing system commandsSean 6.0
String to integerMayur Avhad 5.9
Use const variables as function parameters when pobeyonddc 5.9
Prefer pre-increment and pre-decrementKarl 5.9
Use STL containers instead of C arraysSang-drax 5.9
Modifying const variablesWiro Sableng 5.9
.c is used for c while .cpp is used for c++G.P. 5.9
pre & post increment & decrement operators jay 5.9
Turn on all compiler warningsMaragato 5.8
Avoid memory wastageArthi 5.8
Operator Associativity and HierarchyAvinash 5.8
Use multiple filesThantos 5.8
Use <constant> == <value>Webmaster 5.8
Commenting out code with the preprocessorWebmaster 5.7
Goto vs. Higher-level control structuresSean 5.7
beware of loop invarinatsIain 5.7
Be careful of Magic behaviour due to compilers manik 5.7
Member Functions are inline by default (C++)Ash 5.7

Next 30
Previous 30

Help your fellow programmers! Add a tip!