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
Misc
8.8K+ articles
C++
4.3K+ articles
C Language
1.8K+ articles
C Basics
77+ articles
memory-management
52+ articles
Dynamic Memory Allocation
23+ articles
C++-new and delete
12+ articles
c-memory-management
5+ articles
C-Dynamic Memory Allocation
26 posts
Recent Articles
Popular Articles
what happens when you don't free memory after using malloc()
Last Updated: 05 October 2021
Pre-requisite: Dynamic memory allocation in CThe "malloc" or "memory allocation" method is used to dynamically allocate a single large block of memory with the specified s...
read more
C Language
Picked
C-Dynamic Memory Allocation
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
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
free() Function in C Library With Examples
Last Updated: 29 May 2023
The free() function in C is used to free or deallocate the dynamically allocated memory and helps in reducing memory wastage. The C free() function cannot be used to free ...
read more
C Language
C-Dynamic Memory Allocation
c-memory-management
How to Dynamically Create Array of Structs in C?
Last Updated: 22 February 2024
In C, an array is a data structure that stores the collection of elements of similar types. Structs in C allow the users to create user-defined data types that can contain...
read more
C Programs
C Language
Picked
C-Arrays
C-Structure & Union
C-Dynamic Memory Allocation
C Examples
How to Initialize Array of Pointers in C?
Last Updated: 22 February 2024
Arrays are collections of similar data elements that are stored in contiguous memory locations. On the other hand, pointers are variables that store the memory address of ...
read more
C Programs
C Language
Picked
C-Pointers
C-Arrays
C-Dynamic Memory Allocation
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 Create a Dynamic Array of Structs?
Last Updated: 01 March 2024
In C, we have dynamic arrays in which we can allocate an array of elements whose size is determined during runtime. In this article, we will learn how to create a dynamic ...
read more
C Programs
C Language
Picked
c-array
C-Structure & Union
C-Dynamic Memory Allocation
C Examples
Difference Between Stack-Allocated and Heap-Allocated Arrays
Last Updated: 03 April 2024
In C/C++, arrays can be allocated in two areas of memory: the stack and the heap. Each has its own characteristics and use cases. In this article, we will see the key diff...
read more
C++ Programs
C++
Picked
c-array
cpp-array
C-Arrays
C-Dynamic Memory Allocation
CPP Examples
How to Create a Dynamic Array of Strings in C?
Last Updated: 22 April 2024
In C, dynamic arrays are essential for handling data structures whose size changes dynamically during the program's runtime. Strings are arrays of characters terminated by...
read more
C Programs
C Language
Picked
C-Arrays
C-Dynamic Memory Allocation
C Strings Programs
C Examples
How to Detect Memory Leaks in C?
Last Updated: 13 June 2024
In C, memory leaks occur when programmers allocate memory by using functions like malloc, calloc, realloc etc., but forget to deallocate the memory by using free function....
read more
C Programs
C Language
Picked
C-Dynamic Memory Allocation
C Error Handling Programs
C Examples
How to Initialize a Dynamic Array in C?
Last Updated: 27 June 2024
In C, dynamic memory allocation is done to allocate memory during runtime. This is particularly useful when the size of an array is not known at compile time and needs to ...
read more
C Programs
C Language
Picked
c-array
C-Arrays
C-Dynamic Memory Allocation
C Examples
How to Release Memory in C?
Last Updated: 17 June 2024
In C programming, releasing memory means deallocating memory that was previously allocated dynamically using functions like malloc(), calloc(), or realloc(). In this artic...
read more
C Programs
C Language
Picked
C-Dynamic Memory Allocation
C Examples
Deleting Memory in C
Last Updated: 24 July 2024
In C programming, we might allocate memory dynamically for various tasks but what happens when those pieces of memory are no longer needed? If not managed properly, they c...
read more
C Language
Picked
C-Dynamic Memory Allocation
c-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 !