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)
Better enumsBrent 8.7
The power of scanf()Joanna 8.6
Make pointer and reference arguments constAkshay 8.5
Set the most significant bit of an int Alphonse Ajayan 8.4
Using _strtime and _strdate to get the timeAli Jafar 8.4
What is a friend function?Ali Nawkhas Murad 8.4
Avoid stl set non-const iteratorsIgor 8.4
In C++ a pure abstract base class is a contractMarty Corbett 8.3
Use virtual functions instead of type checkingSajan 8.3
difference between float and doubleankit panwar 8.2
Count number of bits in an integer.Anjani Kumar Mishra 8.2
gets is dangerouscarl johnson 8.2
Why you can't dereference a void* pointerashish mathur 8.1
Long variable namesCarl 8.1
swap with out using temporaryraghava 8.1
Declaration of abstract class in c++Ali Nawkhas Murad 8.1
Swap without temporary variableMoosa Baransi 8.0
Differences between class and structAli Nawkhas Murad 7.9
Passing array elements to functionsUmer khan 7.9
Benefits of inline functionsAli Nawkhas Murad 7.9
Display Date and Time in C++Govind 7.7
Copy constructorAli Nawkhas Murad 7.6
Passing a pointer to a functionIrfaan Kamo 7.6
do not use printf without %s to print a stringpavan kumar 7.6
logical error on divisionM.Kumaran 7.6
Rounding to an IntegerGorn 7.5
Temporariless SwapGuille 7.4
assert() yourself!Kevin Lam 7.4
Comparisons in C\C++Nikitas Angelinas 7.4
Don't use strlen in a loop condition.anonytmouse 7.4

Next 30

Help your fellow programmers! Add a tip!