Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
DSA
22.8K+ articles
Arrays
6.5K+ articles
C++
4.3K+ articles
Difference Between
3.6K+ articles
C Language
1.8K+ articles
C Programs
705+ articles
C Basics
77+ articles
C-Dynamic Memory Allocation
26+ articles
C++-new and delete
12+ articles
Dynamic Memory Allocation
23 posts
Recent Articles
Popular Articles
Program to find largest element in an array using Dynamic Memory Allocation
Last Updated: 21 November 2022
Given an array arr[] consisting of N integers, the task is to find the largest element in the given array using Dynamic Memory Allocation.Examples:Input: arr[] = {4, 5, 6,...
read more
C Programs
C++ Programs
DSA
Arrays
C-Pointers
Dynamic Memory Allocation
What happens if we mix new and free in C++?
Last Updated: 22 October 2020
As we know that new is used to create memory dynamically and it is the programmer's responsibility to delete the memory location explicitly and it is deleted by using the ...
read more
C++ Programs
C++
C-Dynamic Memory Allocation
Dynamic Memory Allocation
C++-new and delete
new and delete
Static and Dynamic Memory Allocation in C
Last Updated: 23 April 2021
Memory is divided into smaller addressable units called bytes. Assume that these are small boxes as bytes. Each byte has its own address as per the below table.For example...
read more
C Programs
C Language
C Basics
C-Dynamic Memory Allocation
Dynamic Memory Allocation
Dynamic initialization of object in C++
Last Updated: 31 December 2021
In this article, we will discuss the Dynamic initialization of objects using Dynamic Constructors.Dynamic initialization of object refers to initializing the objects at a ...
read more
Technical Scripter
C++ Programs
C++
Technical Scripter 2020
cpp-constructor
C++-Constructors
Dynamic Memory Allocation
new and delete
C++ malloc()
Last Updated: 02 February 2023
The function malloc() in C++ is used to allocate the requested size of bytes and it returns a pointer to the first byte of allocated memory. A malloc() in C++ is a functio...
read more
C++
Dynamic Memory Allocation
cpp-memory-management
Difference between Static Arrays and Dynamic Arrays
Last Updated: 20 December 2023
In the Data structure, we know that an array plays a vital role in having similar types of elements arranged in a contiguous manner with the same data type. According to t...
read more
DSA
Arrays
Dynamic Memory Allocation
Does Garbage Collection Guarantee that a Program will not Run Out of Memory?
Last Updated: 06 December 2023
The work of Garbage collection in Java isto automate the process of deleting memory that's no longer in use. But does that mean Java programs are free from memory limit ov...
read more
DSA
GFacts
Dynamic Memory Allocation
java-garbage-collection
How to Initialize a Dynamic Array in C++?
Last Updated: 31 January 2024
In C++, dynamic arrays allow users to allocate memory dynamically. They are useful when the size of the array is not known at compile time. In this article, we will look a...
read more
C++ Programs
C++
Picked
cpp-array
Dynamic Memory Allocation
C++-new and delete
C++ Array Programs
CPP Examples
How to Create Custom Memory Allocator in C++?
Last Updated: 01 March 2024
In C++ containers, memory allocation is generally managed by allocators through new and delete operators or malloc() and free() functions but for custom memory management ...
read more
C++
Picked
memory-management
Dynamic Memory Allocation
CPP Examples
How to Find Size of Dynamic Array in C?
Last Updated: 11 March 2024
In C, dynamic memory allocation allows us to manage memory resources during the execution of a program. It’s particularly useful when dealing with arrays where the size is...
read more
C Programs
C Language
Picked
C-Arrays
C-Dynamic Memory Allocation
Dynamic Memory Allocation
C Examples
How to Dynamically Resize a C++ Array?
Last Updated: 06 March 2024
In C++, an array is a collection of elements of the same type placed in contiguous memory locations. In this article, we will learn how to dynamically resize an array in C...
read more
C++ Programs
C++
Picked
cpp-array
Dynamic Memory Allocation
CPP Examples
How to Find the Size of a Dynamically Allocated Array in C++?
Last Updated: 06 March 2024
In C++, dynamic memory allocation enables the users to manage the memory resources during the execution of the program and is very useful for arrays when the size of the a...
read more
C++ Programs
C++
Picked
cpp-array
Dynamic Memory Allocation
C++-new and delete
CPP Examples
How to Release Memory in C++?
Last Updated: 04 April 2024
In C++, releasing memory means deallocating the memory that was previously allocated by the user. It is very important to avoid memory leaks. Other programming languages l...
read more
C++ Programs
C++
Picked
memory-management
Dynamic Memory Allocation
C++-new and delete
CPP Examples
How to Detect Memory Leaks in C++?
Last Updated: 05 July 2024
Memory leaks are a common and serious problem in C++ programming. They occur when dynamically allocated memory using operators likenewor functions likemalloc from the heap...
read more
C++ Programs
C++
Picked
Dynamic Memory Allocation
C++-Exception Handling
CPP Examples
std::make_shared in C++
Last Updated: 25 September 2024
In C++, std::make_shared() is a function that returns a shared pointer to the object of specific type after dynamically creating it. It offers a safer and more efficient w...
read more
C++
cpp-pointer
Dynamic Memory Allocation
cpp-memory-management
1
2
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !