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)
.c is used for c while .cpp is used for c++G.P. 5.8
Always check for NULL (in C)Webmaster 5.6
Always write if statements with bracesWebmaster 5.9
Arguments for MainSajan 3.3
assert() yourself!Kevin Lam 6.1
Assigning a char array to another char arrayBrian Plummer 3.0
Automatic Array initialisationkedar 3.6
Avoid memory wastageArthi 5.8
Avoid stl set non-const iteratorsIgor 5.9
Avoid void main()Webmaster 6.0
backups using CVS save you lot of spaceLeif 5.3
Be careful about array size when u are using strcpBhushan Verma 5.8
Be careful of Magic behaviour due to compilers manik 5.7
Be careful when storing pointers inside unionssingam kiran reddy 5.6
Be organisedProphet-Ex 5.7
Benefits of a Lookup TableAli Nawkhas Murad 4.3
Benefits of inline functionsAli Nawkhas Murad 5.6
Better coding style for comparisonnids 5.9
Better enumsBrent 5.9
beware of loop invarinatsIain 5.7
C and C++ bit Operations Trickssedfy 7.8
C++ is not a pure Object Oriented Language..Hridesh Vishwdewa 5.0
C++ new does not return 0 on failure!Are R. Svendsen 5.2
char *pa; and char a[];avdtech 5.6
Check the return value of scanf( )citizen 5.4
Checking if two arrays are equalUnnikrishnan T A 4.8
clean up after cin (C++)Major_Small 5.8
Clever ways to avoid using if statementsA. Karthick Pandia Samy 5.8
Code Optimization TipsBasker Swaminathan 6.1
Comment!VOX 5.7

Next 30

Help your fellow programmers! Add a tip!