/**
 * File: memory.c
 * --------------
 * This program is a short example of accessing memory.  If we run it
 * twice on the same machine at the same time, it may appear use the same address,
 * because of virtual memory.
 */

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdbool.h>


int main(int argc, char *argv[]) {
  pid_t pidOrZero = fork();

  // child
  if (pidOrZero == 0) {
    int x = 5;
    void *p = &x;
    printf(" I am the child and I made an int %d at address %p\n", x, p);  
  } else {
    int x = 2;
    void *p = &x;
    printf("I am the parent and I made an int %d at address %p\n", x, p);  
  }

  return 0;
}
