// You can think of there being two sorts of arrays. // // One, like alpha, where the entire array is local to the function. // The other, like beta, where only a pointer to the data is local // to the function. The data that it points to lives elsewhere. // // Complicating the issue is the fact that the name of an array, // like alpha, can be treated as a pointer. That’s how we can // call show() with alpha as an argument. alpha, which is the name // of an array, is converted into the pointer ptr. #include using namespace std; // Show an array of data. You have to pass the length, because C++ doesn’t // know the length of a C-style array. void show(int *ptr, int length) { // cout << "size of ptr: " << sizeof(ptr) << '\n'; for (int i=0; i