What is an array of pointers? Is it possible to have negative index in an array? Why is it necessary to give the size of an array in an array declaration?
An array of pointers is an array that consists of variables of pointer type, which means that the variable is a pointer addressing to some other element.
According to me it is possible only and only if an array is a pointer that points to the second element in an array or a later element. else it is not valid , because you would be accessing memory outside the bounds of the array.
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.
Comments
Leave a comment