Why is dynamic memory allocation used when dealing with arrays in C?

  • To allow flexible array sizes
  • To improve performance
  • To reduce memory usage
  • To simplify array manipulation
Dynamic memory allocation in C allows for the allocation and deallocation of memory during program execution, which is essential when the array size is not known at compile-time. It provides flexibility in memory usage.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *