First , let us see the follow two functions :

JerryCheng 發表在 痞客邦 留言(0) 人氣()

friend class is a class that can access the private members of a class as though it were a member of that class.

we can define an entire class as a friend as follow :

JerryCheng 發表在 痞客邦 留言(0) 人氣()

Multiple inheritance enables a derived class to inherit members from more than one parent.


JerryCheng 發表在 痞客邦 留言(0) 人氣()

When one class inherits from another, the derived class inherits the variables and functions of the base class. 

These variables and functions become part of the derived class.

JerryCheng 發表在 痞客邦 留言(0) 人氣()

Static member function means that we  can be called directly by using the class name and the scope operator.

for example :

JerryCheng 發表在 痞客邦 留言(0) 人氣()

Static member variable

Static member variable is similar to global variable , but it is applied to class.

JerryCheng 發表在 痞客邦 留言(0) 人氣()

Operator overloading allows the programmer to define how operators (such as +, -, ==, =, and !) should interact with various data types. 

Because operators in C++ are implemented as functions, operator overloading works very analogously to function overloading.

JerryCheng 發表在 痞客邦 留言(0) 人氣()

Constructor:

Constructors are typically used to initialize member variables of the class to appropriate default values.

JerryCheng 發表在 痞客邦 留言(0) 人氣()

In the class , we can define public or private for its data member (or method).

The data member can only be used by method of class if we define the type of data member is public.

JerryCheng 發表在 痞客邦 留言(0) 人氣()

In C++, classes are very much like structs, except that classes provide much more power and flexibility.

In C++, when we declare a variable of a class, we call it instantiating the class. The variable itself is called an instance of the class. A variable of a class type is also called an object.

JerryCheng 發表在 痞客邦 留言(0) 人氣()

Union is like strucuture but it can only assign one member one time , and a anonymous union is a union without class name .

Anonymous can help us save memory space  , because operation system would allocate the largest memory space of largest

JerryCheng 發表在 痞客邦 留言(0) 人氣()

We can use #define to define a constant or a Marco.

for example: (define a constant)

JerryCheng 發表在 痞客邦 留言(0) 人氣()

A default parameter is a function parameter that has default value.

 

JerryCheng 發表在 痞客邦 留言(0) 人氣()

 

The method list() in the File class can help you to achieve this purpose.

JerryCheng 發表在 痞客邦 留言(0) 人氣()

Reference is a alias of a variable , it can be used to instead of pointer sometimes.

C++ references differ from pointers in several essential ways:

JerryCheng 發表在 痞客邦 留言(0) 人氣()

Sometimes we may generate the functions which have the same function 

but have different argument or return type.

JerryCheng 發表在 痞客邦 留言(0) 人氣()

Arithmetic operators (+ , - , * , \ , %)

Relational and euality operators

JerryCheng 發表在 痞客邦 留言(0) 人氣()

We can use the modifier , setw , to control the width of output.

 

JerryCheng 發表在 痞客邦 留言(0) 人氣()

cout, clog and cerr are pre-defined objects defined in ostream. 

The iostream class inherits from both ostream and istream

JerryCheng 發表在 痞客邦 留言(0) 人氣()

We can use the operator , dec , oct , and hex to decide which format we want.

for example:

JerryCheng 發表在 痞客邦 留言(0) 人氣()