Getting different size of array from main function and custom function

getting different size of array from main function and custom function
why is it so
please help
https://ide.codingblocks.com/s/49674

Hi Jai, C++ does not allow to pass an entire array as an argument to a function. So, when we pass an array to a function, it is passed as a pointer to the array. When an array is stored in memory, it takes contiguous space, but the length of the array doesn’t matter as far as the function are concerned because C++ performs no bounds checking for the formal parameters.

So basically, when you use sizeof on the parameter, you are taking the size of the pointer, not the array itself.