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
C++
4.3K+ articles
Difference Between
3.6K+ articles
C++ Programs
2.4K+ articles
Articles
274+ articles
memory-management
52+ articles
C-Dynamic Memory Allocation
26+ articles
Dynamic Memory Allocation
23+ articles
Constructors
14+ articles
new and delete
3+ articles
C++-new and delete
56 posts
Recent Articles
Popular Articles
delete keyword in C++
Last Updated: 11 January 2025
delete is an operator that is used to destroy array and non-array(pointer) objects which are dynamically created by the new operator.delete can be used by either using the...
read more
C++
Picked
cpp-operator
Dynamic Memory Allocation
C++-new and delete
cpp-memory-management
new vs malloc() and free() vs delete in C++
Last Updated: 01 November 2023
We use new and delete operators in C++ to dynamically allocate memory whereas malloc() and free() functions are also used for the same purpose in C and C++. The functional...
read more
Difference Between
Articles
C++
Constructors
Dynamic Memory Allocation
C++-new and delete
If memory allocation using new is failed in C++ then how it should be handled?
Last Updated: 20 July 2021
In this article, if memory allocation using new is failed in C++ then how it should be handled? When an object of a class is created dynamically using new operator, the ob...
read more
C++
memory-management
C-Dynamic Memory Allocation
C++-new and delete
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
How to declare a 2D array dynamically in C++ using new operator
Last Updated: 14 September 2022
Prerequisite: Array BasicsIn C/C++, multidimensional arrays in simple words as an array of arrays. Data in multidimensional arrays are stored in tabular form (in row major...
read more
Technical Scripter
C++
Technical Scripter 2020
DSA
Arrays
cpp-pointer
Pointers
C++-new and delete
Difference between int* p() and int (*p)()?
Last Updated: 11 December 2020
A pointer is a variable whose value is the address of another variable, i.e., direct address of the memory location. Like any variable or constant, a pointer must be decla...
read more
C/C++ Puzzles
Algorithms
C Language
C++
C Quiz
C++ Quiz
DSA
C Basics
cpp-pointer
Pointers
C++-new and delete
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 Delete a Pointer in C++?
Last Updated: 19 February 2024
In C++, memory management is essential to avoid memory leaks, crashes, and undefinable behavior. In this article, we will learn how to properly delete a pointer in C++.Del...
read more
C++ Programs
C++
Picked
cpp-pointer
C++-new and delete
CPP Examples
How to Dynamically Allocate Memory for an Array of Strings?
Last Updated: 07 February 2024
Dynamic memory and static memory are two types of memory allocation methods in C++ programming. Dynamic memory allows programmers to allocate memory to data structures at ...
read more
C++ Programs
C++
Picked
cpp-array
cpp-pointer
memory-management
C++-new and delete
cpp-strings
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 Dynamically Allocate an Array in C++?
Last Updated: 21 May 2024
In C++, dynamic memory allocation allows us to allocate memory during runtime. Dynamic allocation in an array is particularly useful when the size of an array is not known...
read more
C++ Programs
C++
Picked
cpp-array
C++-new and delete
C++ Array Programs
CPP Examples
1
2
3
4
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 !