/* * CS 161-020, Lecture 18, Winter 2020 * Static and dynamic arrays * Author: Kiri Wagstaff * Date: February 17, 2020 */ #include using namespace std; /* Print an array; 'kind' should be 'stack' or 'heap' */ void print_arr(const string kind, const int* a, const int n) { /* Check validity of array pointer */ if (!a) { cout << kind << "array:\tArray pointer is NULL." << endl; return; } int i = 0; cout << kind << " array:\t"; for (i=0; i