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)
Copy constructorAli Nawkhas Murad 5.1
Pointer arithmetic trickinessvishesh jain 5.0
Count number of bits in an integer.Anjani Kumar Mishra 5.0
Use const variables as function parameters when pobeyonddc 4.9
Make pointer and reference arguments constAkshay 4.9
Avoid stl set non-const iteratorsIgor 4.7
Increment and decrement counters with rolloverLee Walker 4.6
Checking if two arrays are equalUnnikrishnan T A 4.6
Convert String to SYSTEMTIMESaddam Abu Ghaida 4.6
Tips for writing programs for beginnerspradeep 4.5
Benefits of a Lookup TableAli Nawkhas Murad 4.3
Determining if something was processed in a switch/case constructMarty Corbett 4.3
take care while using new and deleterajender 4.2
C and C++ bit Operations Trickssedfy 4.2
What is pointer arithmetic?Umer khan 4.2
Why you can't dereference a void* pointerashish mathur 4.1
Tip for MacroSankareswari 4.0
finding size of variable without using sizeof()Rajesh punia 3.8
Swap without temporary variableMoosa Baransi 3.7
Dynamic memory allocation of 2d arraysnandam 3.7
Operator precedence shortcutsai shanker 3.6
Automatic Array initialisationkedar 3.6
Rounding a floating point number to a near-fractionSteven 3.5
Arguments for MainSajan 3.5
Effective use of ==Er.Nathan 3.4
Assigning a char array to another char arrayBrian Plummer 3.0
Don't increment the same variable multiple times in one statementsidra 3.0
Understanding the win32 data typesMuhammad Shahid 3.0
Never return a non-const pointer to a data member!hussain hani 3.0
Cute but dangerous code, finding the larger integer without using comparisonsPrakash Samy 3.0

Next 30
Previous 30

Help your fellow programmers! Add a tip!