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.
Loading...
Related Quiz
- What function is used to open a binary file for both reading and writing in C?
- Which function is used to close a file that has been opened for reading or writing?
- The ______ stream in C is used for unbuffered error messages.
- What is the main advantage of using function pointers in C programming?
- In a database application, you need to sort a list of names (strings) in alphabetical order. Which string handling function might be useful in this scenario?