Next: What is C++
Up: Online C++ FAQ/Tutorial and
Previous: Online C++ FAQ/Tutorial and
- instead of macros use
enum to define constants
inline to prevent function call overload
template to declare families of type and families of functions
delete instead of
delete for arrays)
- don't use
void* and pointer arithmetic
- an explicit type conversion reveals an error of conception.
- avoid to use C style tables, use vectors instead.
- don't recode what is already available in the C++ standard library.
- variables can be declared anywhere: initialization can be done
when variable is required.
- whenever a pointer cannot be zero, use a reference.
- when using derived class, destructors should be virtual.
Alexis Angelidis (PhD)