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)
do not use printf without %s to print a stringpavan kumar 5.7
Never do unary minus on sizeofVaibhav 5.7
When optimizing code, focus on algorithms firstAlex Allain 5.7
The many meanings of NULLRajat Kochhar 5.7
gets() is bad.Sean 5.7
Do NOT always check for NULL! (C++)Kevin Lam 5.7
Comment!VOX 5.7
Initialise all variablesJia.Lu 5.6
Don't use fflush(stdin)Shakti 5.6
Dont't use scanf() when reading sentencesRomnico 5.6
initalization of objectsmohit dhawan 5.6
Get a copy of the standardThantos 5.6
Be careful when storing pointers inside unionssingam kiran reddy 5.6
Run code in Different compilersNaren Varma 5.6
getchar() returns an intRob 5.6
Turn off optimization when debuggingAshok Kumar 5.6
Test pieces of your code earlyHardi Pertel 5.6
Use Good Variable And Function Namesprog-bman 5.6
Use templates to prevent memory leakageKunal 5.6
Fastest raise to power.Ezzetabi 5.6
Always check for NULL (in C)Webmaster 5.6
Use makefilecjediknight 5.6
Passing array elements to functionsUmer khan 5.6
Executing system commandsSean 5.6
char *pa; and char a[];avdtech 5.6
Benefits of inline functionsAli Nawkhas Murad 5.6
take advantage of array indiciesDave 5.6
Safely using strncpyoliv29 5.6
String to integerMayur Avhad 5.6
Use the Appropriate VariablesMahesh Kumar.S 5.5

Next 30
Previous 30

Help your fellow programmers! Add a tip!