<!-- hamlet
<!-- copytar
examples/                                                                                           0040755 0002611 0000666 00000000000 06355553517 0013544 5                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        examples/mistake1.c                                                                                 0100644 0002611 0000666 00000000472 06355553514 0015423 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 4 */
/* Illustrates common pointer mistakes.

Created:  Joe Zachary
Modified:
*/

#include <stdio.h>

void main () {

  int n;
  int *p;

  printf("The value of the location p points to is %d\n", *p);

  printf("Give me an integer to store at the location p points to: ");
  scanf("%d", &n);
  *p = n;

}
                                                                                                                                                                                                      examples/mistake2.c                                                                                 0100644 0002611 0000666 00000000565 06355553514 0015427 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 4 */
/* Illustrates common pointer mistakes.

Created:  Joe Zachary
Modified:
*/

#include <stdio.h>


/* This function takes a pointer to an integer as an argument, and
   then prints out the value of the integer variable that it
   pointed to. */

void printer (int *n) {
  printf("Here is the value: %d\n", *n);
}


void main () {
  int x = 2;
  printer(&x);
}
                                                                                                                                           examples/mistake3.c                                                                                 0100644 0002611 0000666 00000000656 06355553514 0015431 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 4 */
/* Illustrates common pointer mistakes.

Created:  Joe Zachary
Modified:
*/

#include <stdio.h>


/* This function takes a pointer to an integer as an argument, and
   then prints out the value of the integer variable that it
   pointed to. */

void printer (int *n) {
  printf("Here is the value: %d\n", *n);
}


void main () {
  int x = 0;
  printf("Please enter an integer: ");
  scanf("%d", &x);
  printer(x);
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  