I have a broad level question regarding best practices for passing arrays into functions.
So in the past when I've been programming in C and I wanted a function to have it's input be an array, I would declare that functions input parameters to be a pointer. This worked relatively well.
However, I've began programming more in C++ and am trying to determine the best practice for passing arrays into functions. So I've noticed that it is popular in C++ to pass objects by reference such that expensive copying operations are avoided. However, when I google passing arrays into functions, I read statements saying that arrays are automatically passed by reference.... So what's the deal with this? Why are arrays automatically passed by reference? And let's say I don't want the function to modify the array, is it possible to pass const arrays?
I'm having a difficult time getting my test program to compile. So I'm curious if anyone could explain what it means to pass an array into a function in C++ and how that differs from C.
Thanks!