Top "Dynamic-memory-allocation" questions

Dynamic memory allocation, usually in the context of languages without garbage collection or mandatory or automatic reference counting, refers to the process or asking the operating system for a variable sized block of memory.

How do I properly free memory related to getline() function?

I just started programming and have a beginner question, I want to write a function to read a file with …

c pointers dynamic-memory-allocation getline
Efficient linked list in C++?

This document says std::list is inefficient: std::list is an extremely inefficient class that is rarely useful. It performs …

c++ stl linked-list dynamic-memory-allocation abstract-data-type
C++ - Allocating memory on heap using "new"

If I have the following statement: int *x = new int; In this case, I have allocated memory on the heap …

c++ heap new-operator dynamic-memory-allocation memory-address