Step-by-step explanation:
In C++ or C we don't have a function which tells us the size of array which is required.So it is necessary to pass the size of the arrays in the function.At the time of declaration we declare the size of the array more than we need.Then we store the elements upto the size which is necessary.So the actual size of the array is larger than the size we needed.So hence it is necessary to pass the size of the array.