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 STL containers instead of C arraysSang-drax 5.9
Clever ways to avoid using if statementsA. Karthick Pandia Samy 5.9
Modifying const variablesWiro Sableng 5.9
Pointer Memory allocationKrishnamoorthi 5.9
Differences between class and structAli Nawkhas Murad 5.9
Better enumsBrent 5.9
Be careful about array size when u are using strcpBhushan Verma 5.8
Turn on all compiler warningsMaragato 5.8
Fast multiplicationJean-François Geyelin 5.8
clean up after cin (C++)Major_Small 5.8
High performance loopingRachana 5.8
Avoid memory wastageArthi 5.8
compiler tipJulian Sutherland 5.8
Operator Associativity and HierarchyAvinash 5.8
Use multiple filesThantos 5.8
Multiply rather than DivideReese Moore 5.8
Use <constant> == <value>Webmaster 5.8
Commenting out code with the preprocessorWebmaster 5.7
Make libraries for yourselfValseedian 5.7
Goto vs. Higher-level control structuresSean 5.7
Member Functions are inline by default (C++)Ash 5.7
swap with out using temporaryraghava 5.7
difference between float and doubleankit panwar 5.7
beware of loop invarinatsIain 5.7
Be organisedProphet-Ex 5.7
Be careful of Magic behaviour due to compilers manik 5.7
do not use printf without %s to print a stringpavan kumar 5.7
Do NOT always check for NULL! (C++)Kevin Lam 5.7
Comment!VOX 5.7
Initialise all variablesJia.Lu 5.6

Next 30
Previous 30

Help your fellow programmers! Add a tip!