Generally, data members should be declared private and member functions should be declared public.
set functions also called mutators
get functions also called accessors
classes often provide public member functions to allow clients of the class to set or get private data members.
Initializing objects with constructors:
(constructors are declared public)
1.Function: Each class can provide a constructors that can be used to initialize an object of the class when the object is created.
2.Define: A constructor is a special member function that must be defined with the same name as the class, so that the compiler can distinguish it from the class’s other member functions.
3.Difference between constructors and other functions : constructors cannot return value
A default constructors -that is, a constructor with no parameters (默认构造函数无参)
默认构造函数有两种产生方式:(1)编译器创建 (2)自己写(无参)
头文件 " "先找本地的class < >先找库
function prototype (函数名+返回类型+参数类型)
such as: void display( string );