- Modern C++:Efficient and Scalable Application Development
- Richard Grimes Marius Bancila
- 74字
- 2021-06-10 18:27:55
Using memory in C++
C++ uses the same syntax as C to declare pointer variables and assign them to memory addresses, and it has C-like pointer arithmetic. Like C, C++ also allows you to allocate memory on the stack, so there is automatic memory cleanup when the stack frame is destroyed, and dynamic allocation (on the C++ free store) where the programmer has the responsibility to release memory. This section will cover these concepts.