
/* BUG ZONE!!!
Example: some common string errors */

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

main()
{
  char thing[100];
  char *wing=thing;
  char string[41];
  char name[6] = "David";
  char name1[50] = {'D','a','v','i','d','j','u','n','k','\0'};

  puts(name1);
  
  strcpy(thing,"What is this thing called love?");
  wing = "How long is a piece of string?";  
  /* above is ok because I have a pointer now
     to point at the array */
  
  puts("Enter a word, not more than 10 characters: ");
  scanf("%s",string); 
  
  puts("Enter a sentence, not more than 40 characters: ");
  scanf("%s",string);  /* BUG */
  
  strcpy(name, "Frankenstein");  /* BUG */
/*  strcpy(wing, "Oh, for the wings of a dove!");*/  /* BUG */
  strcpy(thing, "Oh, for the wings of a dove!");
/*  strcpy("Elvis Presley", string); */ /* BUG */
  strcpy(string,"Elvis Presley");
  strcat(name, "Sir Isaac Newton");  /* BUG */ /* this can be
                                       solved by increasing size of name array*/


/* checkout strcmp: =0,<0,>0 if s1==s2,s1<s2,s1>s2 
then strncmp*/

}
