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. 6.0
Always check for NULL (in C)Webmaster 6.0
Always write if statements with bracesWebmaster 7.0
Arguments for MainSajan 6.9
assert() yourself!Kevin Lam 7.1
Assigning a char array to another char arrayBrian Plummer 6.3
Automatic Array initialisationkedar 7.0
Avoid memory wastageArthi 5.8
Avoid stl set non-const iteratorsIgor 5.9
Avoid void main()Webmaster 6.6
backups using CVS save you lot of spaceLeif 6.2
Be careful about array size when u are using strcpBhushan Verma 6.5
Be careful of Magic behaviour due to compilers manik 5.7
Be careful when storing pointers inside unionssingam kiran reddy 6.4
Be organisedProphet-Ex 7.0
Benefits of a Lookup TableAli Nawkhas Murad 4.6
Benefits of inline functionsAli Nawkhas Murad 6.5
Better coding style for comparisonnids 7.3
Better enumsBrent 5.9
beware of loop invarinatsIain 5.7
C and C++ bit Operations Trickssedfy 5.5
C++ is not a pure Object Oriented Language..Hridesh Vishwdewa 6.8
C++ new does not return 0 on failure!Are R. Svendsen 6.4
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.9
clean up after cin (C++)Major_Small 6.6
Clever ways to avoid using if statementsA. Karthick Pandia Samy 6.4
Code Optimization TipsBasker Swaminathan 6.5
Comment!VOX 5.7

Next 30

Help your fellow programmers! Add a tip!