/* Program to illustrate string overflow and similar troubles. */

#include <stdio.h>
#include <string.h>

char a[4] = "abcd";
char b[4] = "wxyz";
char c[4];
char d[4];
char e[20];

int main (void) {
  strcpy (c, "123");
  strcpy (d, "678");
  strcpy (e, "ABCDEFGHIJKLMNOPQRST");

  /* show initializations */
  printf ("a = %s\n", a);
  printf ("b = %s\n", b);
  printf ("c = %s\n", c);
  printf ("d = %s\n", d);
  printf ("e = %s\n", e);

  /* more copying */
  strcpy (c, a);
  strcpy (d, b);
  strcpy (e, a);
  
  /* show results of copying */
  printf ("a = %s\n", a);
  printf ("b = %s\n", b);
  printf ("c = %s\n", c);
  printf ("d = %s\n", d);
  printf ("e = %s\n", e);

  return 0;
}

