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. 4.8
Always check for NULL (in C)Webmaster 5.6
Always write if statements with bracesWebmaster 5.6
Arguments for MainSajan 4.5
assert() yourself!Kevin Lam 5.6
Assigning a char array to another char arrayBrian Plummer 4.3
Automatic Array initialisationkedar 4.7
Avoid memory wastageArthi 5.4
Avoid stl set non-const iteratorsIgor 4.9
Avoid void main()Webmaster 5.8
backups using CVS save you lot of spaceLeif 5.4
Be careful about array size when u are using strcpBhushan Verma 5.4
Be careful of Magic behaviour due to compilers manik 6.1
Be careful when storing pointers inside unionssingam kiran reddy 5.7
Be organisedProphet-Ex 5.9
Benefits of a Lookup TableAli Nawkhas Murad 5.7
Benefits of inline functionsAli Nawkhas Murad 5.5
Better coding style for comparisonnids 5.6
Better enumsBrent 5.5
beware of loop invarinatsIain 5.8
C and C++ bit Operations Trickssedfy 4.8
C++ is not a pure Object Oriented Language..Hridesh Vishwdewa 5.9
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 4.5
Checking if two arrays are equalUnnikrishnan T A 5.3
clean up after cin (C++)Major_Small 5.7
Clever ways to avoid using if statementsA. Karthick Pandia Samy 5.7
Code Optimization TipsBasker Swaminathan 5.5
Comment!VOX 5.9

Next 30

Help your fellow programmers! Add a tip!