What is the disadvantage of arrays in C?
a) Fixed size
b) Dynamic allocation
c) Random access
d) None of the above
Answer:
a) Fixed size
Explanation:
The main disadvantage of arrays in C is that they have a fixed size, which means the size of the array must be known at compile time and cannot be changed at runtime. This limitation makes arrays less flexible compared to other data structures like linked lists, which can grow or shrink dynamically.
Understanding the limitations of arrays is important for choosing the appropriate data structure for your program’s needs.