Top "Realloc" questions

C library function for reallocating a dynamically allocated memory region.

glibc detected, realloc(): invalid pointer

I apologize for the lengthy code. I have a simple question, but I thought I include my code so it …

c malloc free glibc realloc
Using realloc (X, 0) instead of free() and using malloc with length of a string +1

So I don't really know how to put the title this time. First of all I'd like to say that …

c memory-management free realloc
Is it safe to realloc memory allocated with new?

From what is written here, new allocates in free store while malloc uses heap and the two terms often mean …

c++ memory-management realloc
What is the correct usage of realloc() when it fails and returns NULL?

Can anyone summarize what is the correct usage of realloc()? What do you do when realloc() fails? From what I …

c memory realloc
How do I allocate more space for my array of C structs?

I'm trying to add 10 more elements to my struct that has been already malloc with a fixed sized of 20. This …

c struct malloc realloc
simple c malloc

While there are lots of different sophisticated implementations of malloc / free for C/C++, I'm looking for a really simple …

c malloc realloc
Passing a dynamic array in to functions in C

I'm trying to create a function which takes an array as an argument, adds values to it (increasing its size …

c arrays function realloc
Replacing realloc (C --> C++)

In an earlier question, I asked about typecasting pointers, but was directed to the better solution of using the C++ …

c++ c void-pointers realloc
Is it safe to use realloc?

Some time ago a friend of mine told me not to use realloc because it's unsafe, but he couldn't tell …

c memory-leaks memory-management realloc
Do I need to initiallize(set to 0) memory after calling realloc?

I need to implement a simple dynamic array of pointers to a typedef'ed pointer. Using realloc each time it's requested …

c void-pointers realloc