/*
CS371p: Quiz #12 (5 pts)
*/

/* -----------------------------------------------------------------------
1. What two techniques are used to resolve method redefinition?
   [Sec. 15.4, Pg. 299]
   (1 pt)

merge and hierarchical model
*/

/* -----------------------------------------------------------------------
2. What is the output of the following program?
   (3 pts)

true
2 4 5
*/

#include <iostream> // cout, endl

using namespace std;

void f (int p[], int* q) {
    cout << (sizeof(p) == sizeof(q)) << endl;
    ++p;
    ++*p;
    p = 0;
    ++q;
    ++*q;
    q = 0;}

int main () {
    cout << boolalpha;    // bool outputs as true or false

    int a[] = {2, 3, 4};
    f(a, a + 1);
    cout << a[0] << " ";
    cout << a[1] << " ";
    cout << a[2] << endl;

    return 0;}


syntax highlighted by Code2HTML, v. 0.9.1