다음을 통해 공유


메모리 관리: 크기 조정 가능한 메모리 블록

The new and delete operators, described in the article Memory Management: Examples, are good for allocating and deallocating fixed-size memory blocks and objects. Occasionally, your application may need resizable memory blocks. You must use the standard C run-time library functions malloc, realloc, and free to manage resizable memory blocks on the heap.

중요

Mixing the new and delete operators with the resizable memory-allocation functions on the same memory block will result in corrupted memory in the Debug version of MFC.You should not use realloc on a memory block allocated with new.Likewise, you should not allocate a memory block with the new operator and delete it with free, or use the delete operator on a block of memory allocated with malloc.

참고 항목

개념

메모리 관리: 힙 할당