Top "Free" questions

Do not use this tag to refer to free software.

How does free know how much to free?

In C programming, you can pass any kind of pointer you like as an argument to free, how does it …

c size pointers free
Allocate memory and save string in c

I was wondering why the following code isnt't working int main(int argc, char **argv) { char *test = (char*) malloc(12*sizeof(…

c string malloc free
How to check if a pointer is freed already in C?

I would like to check if a pointer is freed already or not. How do I do this using gnu …

c pointers free
Unable to free const pointers in C

How can I free a const char*? I allocated new memory using malloc, and when I'm trying to free it …

c constants free
When should I use free() in C?

The code works as it is supposed to, though it never frees the memory allocated by malloc(). I have tried …

c malloc free
C: Correctly freeing memory of a multi-dimensional array

Say you have the following ANSI C code that initializes a multi-dimensional array : int main() { int i, m = 5, n = 20; int **…

c memory-management memory-leaks free malloc
malloc implementation?

I'm trying to implement malloc and free for C, and I am not sure how to reuse memory. I currently …

c memory-management malloc free
C++ freeing static variables

I would like my class to have a static pointer to a dynamically allocated region of memory. I understand how …

c++ memory static free destructor
Code for malloc and free

Where can I find the code for malloc my gcc compiler is using at the moment? I actually want to …

c linux malloc free
What can cause "corrupted double-linked list" error?

I am having problems with a fairly complex code. I wasn't able to produce a short snippet that reproduces the …

c++ memory free