C Programming - Memory Allocation - Discussion

1. 

Can I increase the size of dynamically allocated array?

[A]. Yes
[B]. No

Answer: Option A

Explanation:

Use realloc(variable_name, value);

Saranya said: (Oct 27, 2011)  
With out using realloc can I increase the size of dynamically allocated array?

Durgam_anil said: (Aug 24, 2012)  
By using the realloc() we can increase the dynamically allocated memory.

//realloc is used for to allocate the memory already it is allocated and then we are modifing that memory...

Rajjankumarpandey said: (Sep 27, 2012)  
Can we use melloc to increase the size.

Tushar said: (Jul 17, 2015)  
Anyone please give one example code for this?

Ashwini said: (Apr 8, 2016)  
With out using the realloc can I increase the size of dynamically allocated array?

Raj said: (Oct 1, 2019)  
We can use realloc to alter the memory previously allocated using malloc/calloc.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.