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

Next 30

Help your fellow programmers! Add a tip!