answersLogoWhite

0

What is realloc memory allocation?

User Avatar

Anonymous

13y ago
Updated: 8/20/2019

Use help/manual.

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What is the use of realloc in c language?

Realloc is a function in C. It is used to change the size of a block of memory by expanding it. There are various ways realloc can change the memory size, depending on if there is enough space in the block of memory.


What are types of memory allocation?

There are two types of memory allocations. 1. Static memory allocation 2. Dynamic memory allocation


What is the use of realloc in c program?

Increase or decrease the size of the allocated memory. (Note: functionality of malloc and free can be achieved with realloc, too.)


How can you increase the size of a statically allocated array?

/* Allocate space for an array with ten elements of type int. */int *ptr = malloc(10 * sizeof (int));if (ptr == NULL) { /* Memory could not be allocated, the program should handle the error here as appropriate. */ realloc It is often useful to be able to grow or shrink a block of memory. This can be done using realloc which returns a pointer to a memory region of the specified size, which contains the same data as the old region pointed to by ptr (truncated to the minimum of the old and new sizes). If realloc is unable to resize the memory region in-place, it allocates new storage, copies the required data, and frees the old pointer. If this allocation fails, realloc maintains the original pointer unaltered, and returns the null pointer value. The newly allocated region of memory is uninitialized (its contents are not predictable). The function prototype is void *realloc(void *pointer, size_t size);


What is meant by contiguous memory allocation in C?

Contiguous memory allocation in C programming refers to the assigning of consecutive memory blocks to a process. Contiguous memory allocation is one of the oldest and most popular memory allocation schemes in programming.


Compare and contrast dynamic memory allocation and the allocation of files in secondary storage?

Static Memory Allocation: Allocating the total memory requirements that a data structure might need all at once without regard for the actual amount needed at execution time. Dynamic Memory Allocation: The opposite strategy of static memory allocation - Dynamic Memory Allocation, involves allocating memory as-needed.


What Linked list uses.type of memory allocation?

Linked lists use dynamic memory allocation (also called "heap memory allocation", as the linked list is stored in heap memory).


What is contiguous memory allocation in os?

Memory allocation: When a program asks for memory and gets it. Contiguous allocation: When the memory is in one big block, for example memory addresses 1000-2000, as opposed to "fragmented allocation" where the memory comes as several smaller blocks in different places, for example memory addresses 1000-1050, 2050-2125, ...


How do you display matrix in c using dynamic memory allocation?

Memory allocation is not necessary to display a matrix.


What is the malloc function?

The malloc function is one of a group of memory allocation functions; malloc, calloc, realloc, and free. Specifically malloc (size) returns a pointer to a new memory block of at least size bytes, suitably aligned for optimum access for any basic type, or it returns a NULL if the request cannot be satisfied.


Describe the major disadvantages for memory allocation schemes?

= for memory allocation schemes? = http://wiki.answers.com/Q/FAQ/2096= for memory allocation schemes? = http://wiki.answers.com/Q/FAQ/2096


Difference between contiguous and non contiguous memory allocation?

In a contiguous memory allocation there is no overhead during execution of a program. In a non contiguous memory allocation address translation is performed during execution.