Recent Changes - Search:


Reference:

C

edit SideBar

Cplusplus

External Links

The 50 rules from Scott Meyers for effective programming in C++:

  1. prefer const or inline instead #define (strange compiler errors due to text replacing of the preprocessor)
  2. prefer <iostream> instead <stdio.h> (no type testing with stdio)
  3. prefer new and delete instead of malloc and free (are only called by constructors and destructors)
  4. prefer C++ comments not the C /* */ due nesting error possibilities

A chapter that is often under estimated:

templates in c++

 template <class T> bool reange( T value, T min, T max) {
   return value >= min && value <= max;
 }
that is for the compiler. It save these structure for later use.
 bool result = range(5,1,10);
the compiler generates automatically a function with the template above.
 bool range( int value, int min, int max) {
  return value >=min  &&  value <= max;
 }
Edit - History - Print - Recent Changes - Search
Page last modified on August 31, 2010, at 08:17 PM