What would you like to do?

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

already exists.

Would you like to merge this question into it?

already exists as an alternate of this question.

Would you like to make it the primary and merge this question into it?

exists and is an alternate of .

int arr[10]; When an array is declared as above, memory is allocated for the elements of the array when the program starts, and this memory remains allocated during the lifetime of the program. This is known as static array allocation. Hence we cannot increase size of statically allocated array.
14 people found this useful
Thanks for the feedback!

How can you increase the size of a dynamically 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 s

Where is the memory allocated for the array declaration in 'C'?

It depends how the array is declared (fixed size or variable size)  and where it is declared (global scope or local scope).   If the array is declared in global scope (ou

Can you increase cache memory by allocating memory from static RAM?

Cache memory is always static RAM while ram is DRAM. . Cache memory may be static or dynamic but with most modern microprocessors cache memory is internal to the CPU package

What is static and dynamic channel allocation?

In static channel allocation voice channels(definite set of frequencies) is allocated to each cell. But in dynamic channel allocation channels are provided at the time of req

What is a static array in programming?

A static array is no different than any other static class variable - it is an array that is associated with the class itself and is common to all objects of that class.

Calloc allocates a block of memory for an array of elements of a certain size?

No. The calloc function allocates a block of memory for a count of a specific type. The size of the type is already known to the compiler so does not need to be specified, it

How do you delete dynamically allocated array?

You call free... int *a = (int*) malloc (100 * sizeof (int)); /* allocate 100 ints */ ... check to make sure a != NULL ... use a[0] through a[99] as desired free (a);

What do you understand by static memory allocation and dynamic memory allocation?

As to physical memory: Static memory will store its data as long as power is available. It is commonly used with a battery to retain small amounts of data when the main power

How memory is allocated for array type variable?

For any given type, T, a definition of type T[n] will allocate an  array of n elements of type T in contiguous memory, for all  n>=0. The total size of the allocation will b

How is memory allocated to arrays?

It depends where the array is declared and whether or not it isfixed-length or variable-length. The only thing all arrays have incommon is that the memory is allocated contigu