Top "Realloc" questions

C library function for reallocating a dynamically allocated memory region.

How do you 'realloc' in C++?

How can I realloc in C++? It seems to be missing from the language - there is new and delete …

c++ new-operator realloc delete-operator
What header should I include for memcpy and realloc?

I am porting a project to the iPhone and it uses realloc and memcpy which are not found. What is …

c++ objective-c header memcpy realloc
realloc(): invalid next size when reallocating to make space for strcat on char *

I am getting invalid memory error on following code: printf(" %s\n","FINE 5"); printf("%s LENGTH IS: %d\n","FINE 6",…

c string malloc realloc strcat
Dynamic array in C — Is my understanding of malloc and realloc correct?

I am learning how to create dynamic 1D arrays in C. The code below tries to do the following: Using …

c arrays malloc realloc
What does malloc(0) return?

What does malloc(0) return? Would the answer be same for realloc(malloc(0),0)? #include<stdio.h> #include<malloc.…

c linux pointers malloc realloc
Does realloc overwrite old contents?

When we reallocate memory via realloc(), are the previous contents over-written? I am trying to make a program which reallocates …

c realloc
Using realloc to shrink the allocated memory

Simple question about the realloc function in C: If I use realloc to shrink the memory block that a pointer …

c memory-management realloc
How to handle realloc when it fails due to memory?

Question says it all but here is an example: typedef struct mutable_t{ int count, max; void **data; } mutable_t; …

c memory realloc
How to properly reallocate a two-dimensional array in C?

I am trying to load two double numbers from input into a two-dimensional array that is dynamically reallocated by each …

c arrays realloc
Realloc an array of Structs

I am trying to dynamically reallocate memory for an array of structs (actually an array each of 2 structs but 1 included …

c arrays struct realloc