/* Demonstrates how arrays behave when passed as arguments
   Created:  Joe Zachary, Novemver 3, 1992
   Modified:
*/

#include <stdio.h>

/* This function takes an integer as an argument and assigns to it. */

void modifyInt (int n) {
  n = 15;
}


/* This function takes an integer array as an argument and assigns
   to its first entry. */

void modifyArray (int n[]) {
  n[0] = 15;
}


void main (void) {

  int x = 1;
  int y[10] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};

  modifyInt(x);
  modifyInt(y[1]);
  modifyArray(y);

  printf("The value of x is %d\n", x);
  printf("The value of y[1] is %d\n", y[1]);
  printf("The value of y[0] is %d\n", y[0]);

}

