/* Test program to enable discussion of pointers etc (tutw8a.c) */
#include <stdio.h>
#include <stdlib.h>

void addressOnly(int n) {
  printf("addressOnly: address of parameter-var n is %p, val %d.\n", &n, n);
}

void valueOfPoint(int *p) {
  printf("valueOfPoint: value of pointer p is %p, points to val %d.\n", p, *p);
}

int m=8;
 
int main(void) {
  int n=5;
  printf("main: val of n is %d, address of n is %p.\n", n, &n);
  addressOnly(n);
  printf("main: Passing &n into valueOfPoint.\n");
  valueOfPoint(&n);
  printf("\n");
  printf("main: val of m is %d, address of m is %p.\n", m, &m);
  addressOnly(m);
  printf("main: Passing &m into valueOfPoint.\n");
  valueOfPoint(&m);
  return EXIT_SUCCESS;
}
