1. the array name is actually an address.
2. Structure access member. If it is a pointer, the "->" member operator is used. If it is a structure name, the "." member operator is used.
3. The Union can store different data types, but only one of them can be stored at the same time. That is to say, the structure can store int, Char, and long types at the same time, while the shared body can only store int, Char, or long types.
4. pointer: used to store the address. The pointer name indicates the address. * The operator is called an indirect value, or the int * in the unreferenced operator. int * pointer is a type and a pointer (Address) pointing to the int ).
When using new and delete, follow these rules:
(1) do not use Delete to release memory not allocated by new
(2) do not use Delete to release the same memory block twice.
(3) If new [] is used to allocate memory for the array, delete [] should be used to release the array.
(4) If new [] is used to allocate memory for an object, delete should be used to release the object.
(5) Applying Delete to NULL pointer is safe
5. pointer summary:
(1) Declare the pointer format: typename * pointname. Example: Double * Pn, int * pi
(2) pointer assignment: the memory address should be assigned to the pointer. You can apply the & operator to the variable name to obtain the named memory address. The new operator returns the Untitled memory address.
Double * PN; double * pA; char * PC;
Double dnum = 3.2;
Pn = & dnum;
PC = new char;
Pa = new double [30];
(3) Removing Pointer Reference: removing a pointer means getting the value pointed to by the pointer. Delete or operator (*) is used to remove the reference.
(4) When using new, be sure to use Delete to release new memory; otherwise, memory leakage may occur.