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

Next 30

Help your fellow programmers! Add a tip!