13 September 2014

###contructor

  • one class can have several constructors, each of which must take a different number or type of arguments
  • if a class types do not have a default constructor. every definition must provide explicit initializer(s).
  • constructor initlializer list
  • wether the constructor is private.

  • The synthesized default constructor often suffices for classes that contain only members of class type. Classes with members of built- in or compound type should usually define their own default constructors to initialize those members.

###member function

normal member function A member function that is defined inside the class is implicitly treated as an inline function

const memberfunction wether need the const member function.

declare class An incomplete type can be used only in limited ways. Objects of the type may not be defined. An incomplete type may be used to define only pointers or references to the type or to declare (but not define) functions that use the type as a paremeter or return type.