At school, our lecturer taught us that the entire array was passed by reference when we pass its functions.
However, I recently read a book. He says that arrays are passed by default pointer when passing the entire array to a function. The book goes on to say that “following a pointer is very similar to passing by reference,” which means that passing by pointer and passing by reference is really different.
It seems that the other source is different in different ways.
So my question is: In C ++, are arrays passed by reference or by pointer when we pass the entire array to a function?
Example:
void funcA(int []);
int main()
{
int array[5];
funcA(array);
}