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)
In C++ a pure abstract base class is a contractMarty Corbett 10.
Copy constructorAli Murad 10.
Differences between class and structAli Murad 8.1
swap with out using temporaryraghava 7.8
gets is dangerouscarl johnson 7.8
do not use printf without %s to print a stringpavan kumar 7.8
Temporariless SwapGuille 7.4
Rounding to an IntegerGorn 7.3
Comparisons in C\C++Nikitas Angelinas 7.3
logical error on divisionM.Kumaran 7.3
assert() yourself!Kevin Lam 7.2
Always write if statements with bracesWebmaster 7.1
Don't use strlen in a loop condition.anonytmouse 7.1
Declaration of abstract class in c++Ali Murad 7.0
Better coding style for comparisonnids 7.0
When optimizing code, focus on algorithms firstAlex Allain 6.9
difference between int* p and int *p declarationomprakash mishra 6.9
Solve Any Compiler Error EasilyWajahat Karim 6.9
Standard Loop ProgressionDazzle 6.8
Multiply rather than DivideReese Moore 6.8
Common Optimization TipsTravis Fischer 6.8
Keep fit to program betterLuna Man 6.8
Keep a cool head when programmingSentralia 6.8
Pointer Tips :-)Jatin Gandhi 6.8
Be organisedProphet-Ex 6.7
High performance loopingRachana 6.7
Converting numbers to StringsWebmaster 6.7
Never do unary minus on sizeofVaibhav 6.7
C++ new does not return 0 on failure!Are R. Svendsen 6.7
Initialise all variables before useMounish 6.7

Next 30

Help your fellow programmers! Add a tip!