Virtual inheritance (Virtual inheritance):
Syntax: Class Subclass:virtual public baseclass{}
The virtual inherited class (subclass) has no copy of the parent class (BaseClass), and in the subclass of subclass, the constructor should call the BaseClass constructor.
Program error: Compile-time error, run-time error.
Dynamic Memory:
No name, only address, run-time assignment.
Delete only frees memory, the pointer is still in, and the pointer value is still there.
The combination of array name and subscript operator can be considered as: array base address and corresponding pointer operation.
To return memory from a function or method: Call the new statement in a function to allocate a chunk of memory for an object or a data type, and then return the address of the block of memory to the program's main code.
You cannot return the address of a local variable
function pointer: A pointer to the first address of the function is called a functional pointer
Pointer functions: Functions that can return pointer-type data
Replica Builder:
Will copy the corresponding property, but the pointer??? After copying, copy the address, then there will be two objects to control the address ....
Overloads the operator, overloading the assignment operator ("="), in which the pointer is processed: assigns a new position and copies the value past.
The declaration is always assigned a value: MyClass (const MyClass &RHS), which requires a reference of a MyClass type as an input parameter, just like an assignment operator, because it is a constructor that does not require a return type.
The dynamically allocated block of memory is not scoped, but the pointer variable used to hold the address is affected by the scope.
C + + Learning 3