// shows that an array name is an address to the beginning of the array

#include <iostream>
using namespace std;
void  zeroout(int *arr, int n);
void displayarr(const int *arr, int n);

int main()
{

  int number;
  int enrollment[20];
 
  cout << "size of the array enrollment is: " << sizeof(enrollment) << endl;
  cout << "address of array enrollment is: " << enrollment << endl;


  zeroout(enrollment, 20);
  displayarr(enrollment, 20);

  return 0;
}
// an array parameter is the same as accepting a pointer
void  zeroout(int *arr, int n)
{
  cout << "size of the array arr is: " << sizeof(arr) << endl;
  cout << "address of array arr is: " << arr << endl;

// you are allowed to change a pointer variable
 for (int i=0;i<n;i++)
  {
   *arr=0;
   arr++;
  }
}

// accept a pointer to const
// this ensures that the function will NOT modify the values in the array
void displayarr(const int *arr, int n)
{
 for (int i=0;i<n;i++)
  cout << arr[i] << " ";
 cout << endl;
}
