Why is it necessary to give the size of an array in an array declaration?

QuestionsCategory: C ProgrammingWhy is it necessary to give the size of an array in an array declaration?
Clay Hutton asked 3 weeks ago
Please follow and like us:
1 Answers
AdminAdmin answered 3 weeks ago

When an array is declared, the compiler allocates a base address and reserves enough space
In memory for all the elements of the array. The size is required to allocate the required space and hence size must be mentioned.

Please follow and like us: