I'm reading a C++ book which says this:
C++ passes arrays to functions by reference—the called functions can modify the element values in the callers’ original arrays.
It is referring to situations like this:
int hourlyTemperatures[ 24 ];
modifyArray( hourlyTemperatures, 24 );
However, this is vanilla C array pointers at work here, right? There is no use of a C++ "reference" technique, what is being passed is a pointer by value, in this case, a pointer to the first element of the array. The end result is that the function does have access to the full original array, like a reference, but this is not actually pass by reference, right?
From this Prentice Hall book:
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…