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)
The power of scanf()Joanna 8.6
Make pointer and reference arguments constAkshay 8.6
Better enumsBrent 8.6
Using _strtime and _strdate to get the timeAli Jafar 8.4
Avoid stl set non-const iteratorsIgor 8.3
Use virtual functions instead of type checkingSajan 8.3
Set the most significant bit of an int Alphonse Ajayan 8.3
In C++ a pure abstract base class is a contractMarty Corbett 8.3
What is a friend function?Ali Nawkhas Murad 8.3
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
difference between float and doubleankit panwar 8.1
swap with out using temporaryraghava 8.1
Long variable namesCarl 8.1
Declaration of abstract class in c++Ali Nawkhas Murad 8.1
Swap without temporary variableMoosa Baransi 8.0
Passing array elements to functionsUmer khan 8.0
Differences between class and structAli Nawkhas Murad 7.9
Benefits of inline functionsAli Nawkhas Murad 7.9
Display Date and Time in C++Govind 7.7
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
Copy constructorAli Nawkhas Murad 7.5
Rounding to an IntegerGorn 7.5
Temporariless SwapGuille 7.4
assert() yourself!Kevin Lam 7.4
Don't use strlen in a loop condition.anonytmouse 7.4
Comparisons in C\C++Nikitas Angelinas 7.4

Next 30

Help your fellow programmers! Add a tip!