Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
GfG 160
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
DSA
Practice Problems
Python
C
C++
Java
Courses
Machine Learning
DevOps
Web Development
System Design
Aptitude
Projects
Sign In
▲
Similar Topics
C++
4k+ articles
C Language
1.8k+ articles
C Programs
800+ articles
C Quiz
280+ articles
C Examples
95 articles
C-Arrays
65 articles
memory-management
62 articles
C-Structure & Union
53 articles
Dynamic Memory Allocation
31 articles
c-memory-management
5 articles
C-Dynamic Memory Allocation
34 posts
Popular Articles
Recent Articles
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() f
...read more
C Language
C-Dynamic Memory Allocation
c-memory-management
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
...read more
C Basics
C Language
C-Dynamic Memory Allocation
Dynamic Memory Allocation
C Programs
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 dynamic
...read more
memory-management
C++
C-Dynamic Memory Allocation
C++-new and delete
Similar Topics
C++
4k+ articles
C Language
1.8k+ articles
C Programs
800+ articles
C Quiz
280+ articles
C Examples
95+ articles
C-Arrays
65+ articles
memory-management
62+ articles
C-Structure & Union
53+ articles
Dynamic Memory Allocation
31+ articles
c-memory-management
5+ articles
What are the C programming concepts used as Data Structures
Last Updated: 13 December 2021
Data TypesData-type in simple terms gives us information about the type of data.Example, integer, character, etc.Data-types in C language ar
...read more
Arrays
Misc
C Language
Data Structures
C-Arrays
C-Structure & Union
C-Data Types
C-Dynamic Memory Allocation
DSA
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
...read more
C Language
C-Dynamic Memory Allocation
Picked
Dynamic Memory Allocation in C using malloc(), calloc(), free() and realloc()
Last Updated: 06 March 2025
In C, a variable defined in a function is stored in the stack memory. The requirement of this memory is that it needs to know the size of th
...read more
C Basics
C Language
C-Dynamic Memory Allocation
Dynamic Memory Allocation
c-memory-management
Memory leak in C++
Last Updated: 12 March 2025
In C++, memory leak is a situation where the memory allocated for a particular task remains allocated even after it is no longer needed. Thi
...read more
memory-management
C++
C-Dynamic Memory Allocation
cpp-memory-management
Segmentation Fault in C++
Last Updated: 11 January 2025
Segmentation faults C++ is an error that occurs when a program attempts to access a memory location it does not have permission to access. G
...read more
Competitive Programming
memory-management
C Language
C++
C-Dynamic Memory Allocation
DSA
C++ Errors
C | Dynamic Memory Allocation | Question 7
Last Updated: 28 June 2021
What is the problem with following code?[sourcecode language="C"]#includestdio.hint main(){ int *p = (int *)malloc(sizeof(int)); p = N
...read more
C Language
C Quiz
C-Dynamic Memory Allocation
Dynamic Memory Allocation
How to deallocate memory without using free() in C?
Last Updated: 21 October 2022
Question: How to deallocate dynamically allocate memory without using “free()” function. Solution: Standard library function realloc() c
...read more
C Language
C-Dynamic Memory Allocation
Memory Layout of C Programs
Last Updated: 22 January 2025
The memory layout of a program refers to how the program’s data is stored in the computer memory during its execution. Understanding this
...read more
C Language
C-Dynamic Memory Allocation
system-programming
How does free() know the size of memory to be deallocated?
Last Updated: 28 May 2017
Consider the following prototype of free() function which is used to free memory allocated using malloc() or calloc() or realloc().[sourceco
...read more
C Language
C-Dynamic Memory Allocation
Use of realloc()
Last Updated: 28 May 2017
Size of dynamically allocated memory can be changed by using realloc(). As per the C99 standard: [sourcecode language="C"] void *realloc(vo
...read more
C Language
C-Dynamic Memory Allocation
c-memory-management
Difference Between malloc() and calloc() with Examples
Last Updated: 10 January 2025
The functions malloc() and calloc() are library functions that allocate memory dynamically. Dynamic means the memory is allocated during run
...read more
C Language
C-Dynamic Memory Allocation
What is Memory Leak? How can we avoid?
Last Updated: 07 April 2025
In C programming, data can be stored in either stack or heap memory. The stack stores local variables and parameters of the function while t
...read more
Articles
C Language
C-Pointers
C-Dynamic Memory Allocation
1
2
3
>>
Last
1
2
3
>>
Last
1
2
3
>>
Last
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 !