1. failed to realize Memory Allocation
After applying for memory allocation, use it without checking whether the memory allocation is successful.
2. Although the memory has been allocated successfully, it has not been initialized and is used.
This error is mainly because many people think that the memory I just allocated is already initialized, or it is all 0 by default.
Therefore, Initialization is required after the memory is allocated.
3. The memory allocation is successful and initialized. However, the memory usage is out of bounds. In this case, it is not easy to make a mistake.
4. Memory not released
Who must apply for the release of the memory? The memory is applied for in the function you write. Remember to release the memory when the function ends. (Of course, this method is used by others. And if it is called multiple times, it takes a long time to call
If the number is more than one, the game is over ).
5. The memory is released, but it is still used.
This problem is mainly because the pointer is not assigned null after the delete operation, which makes the pointer A wild pointer.