Because name of arrays represent just a pointer to the beginning of the array, we have some limitations or “problems.”
• No Array Out of Bounds Checking is allowed.
For example:
int i a [2] = {0,1};
printf (“%d”, ia [2]);
The above code will lead to segment fault, because you are trying to look at an area of memory not inside the array memory allocation.
void func (int ia [])
void func (int * ia)
Both ate the same declaration. But why would this cause problems? Because only the pointer to the array is passed in, not the whole array. So, what if you mistakenly did a size of (ia) inside func? Instead of returning the size of the whole array, it would only return the size of a single element in the array.
Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.
We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc