Thursday, January 21, 2010

C++ Coding tips


End your programs with a newline to make them portable.
cout << "\n";
-----

Use cerr instead of cout for displaying error messages
-----

Use enum types instead of defining constants (when appropriate). However, do not treat them as integers (i.e. do not use arithmetic operators on them, etc.)

No comments:

Back to Top


 

Labels