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)
Make pointer and reference arguments constAkshay 7.5
match the out side world ideas to logical designinmady 5.3
Member Functions are inline by default (C++)Ash 5.7
Modifying const variablesWiro Sableng 5.8
Multiply rather than DivideReese Moore 6.9
Never do unary minus on sizeofVaibhav 7.0
Never return a non-const pointer to a data member!hussain hani 3.0
One instruction per lineLudovic Flender 5.2
Operator Associativity and HierarchyAvinash 5.9
Operator precedence shortcutsai shanker 4.3
Passing a pointer to a functionIrfaan Kamo 8.4
Passing array elements to functionsUmer khan 7.5
Pointer arithmetic hackVivek Ahlawat 6.3
Pointer arithmetic trickinessvishesh jain 5.9
Pointer Memory allocationKrishnamoorthi 6.8
Pointer Tips :-)Jatin Gandhi 6.8
pre & post increment & decrement operators jay 5.7
Prefer pre-increment and pre-decrementKarl 6.0
Private type in public class scopeIgor 0.0
Programming TipsJatin Gandhi 6.3
Put braces around if statement code, part 2PING 5.3
Reuse Old CodeTimofei Gerasimov 6.0
Rounding a floating point number to a near-fractionSteven 3.5
Rounding to an IntegerGorn 7.4
Run code in Different compilersNaren Varma 6.0
Safely using strncpyoliv29 6.5
Set the most significant bit of an int Alphonse Ajayan 7.9
Solve Any Compiler Error EasilyWajahat Karim 6.9
Standard Loop ProgressionDazzle 6.9
String to integerMayur Avhad 6.0

Next 30
Previous 30

Help your fellow programmers! Add a tip!