---
title: "Difference between realloc() and free?"  
description: "Difference between realloc() and free?"  
author: "Jivika Rai"  
published: 2017-12-12  
canonical: https://answers.mindstick.com/qa/31566/difference-between-realloc-and-free  
category: "technology"  
tags: ["realloc", "free"]  
reading_time: 1 minute  

---

# Difference between realloc() and free?

[Difference](https://yourviews.mindstick.com/view/84555/google-analytics-4-ga4-vs-universal-analytics-actual-difference) between realloc() and free?

## Answers

### Answer by Sangsaptak Pal

Both realloc() and free() are functions of C programming language used for dynamic memory allocation. Both of the functions are defined in the stdlib.h library.

[realloc()](https://www.geeksforgeeks.org/g-fact-66/) : It is a function which is used to dynamically reallocate memory space to an already dynamically allocated memory space to a variable.

free() : It is used to deallocate or free the dynamically allocated memory space allocated to a variable and thus make it available to other variables or other memory functions of the operating system.

![Difference between realloc() and free?](https://www.log2base2.com/images/c/free.png)

Image for free() function

![Difference between realloc() and free?](https://www.log2base2.com/images/c/realloc.png)

Image for realloc() functions


---

Original Source: https://answers.mindstick.com/qa/31566/difference-between-realloc-and-free

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
