title: 0xC0000005: Access violation reading location 0x00000000. c++ vs2015
body: <p>I am working on creating an RPG with a simple text parser, and I am continuing to have problems with acces writing violation in the text parser. Here is my code so far:</p>
  
  <pre><code>/*
  Author: Michael Norris
  Program: Generiquest
  Filename: TextParser.cpp
  Maintainence Log:
  10/28/2015 Created textParser.cpp
  
  
  Notes:
  This text parser is fairly inefficient, but is easier to manage and understand for beginners.
  
  */
  
  
  
  #include &lt;conio.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;Windows.h&gt;
  #include &lt;time.h&gt;
  #include "myheader.h"
  #include &lt;iostream&gt;
  #include &lt;string.h&gt;
  
  
  using namespace std;
  
  class Words
  {
  public:
  Words()
  {
      word verbs[30];//This is an array of all the verbs
      strcpy(verbs[0].text, "Items"); 
      strcpy(verbs[1].text, "Stats");
      strcpy(verbs[2].text, "Use");
      strcpy(verbs[3].text, "Eat");
      strcpy(verbs[4].text, "Throw");
      strcpy(verbs[5].text, "Drop");
      strcpy(verbs[6].text, "Look");
      strcpy(verbs[7].text, "Move");
      strcpy(verbs[8].text, "Put");
      strcpy(verbs[9].text, "Speak");
      strcpy(verbs[10].text, "Attack");
      strcpy(verbs[11].text, "Go");
      strcpy(verbs[12].text, "Climb");
      strcpy(verbs[13].text, "Open");
      strcpy(verbs[14].text, "Take");
      strcpy(verbs[15].text, "Put");
      strcpy(verbs[16].text, "Kill");
      strcpy(verbs[17].text, "Get");
      strcpy(verbs[18].text, "LOL");
  
      //End of verb declarations
      for (int ele = 0; ele &lt; 19; ele++)
      {
          verbs[ele].type = verb;
      }
  
  }
  
  
  
  
  };
  
  Words mainWords;
  void textParser()
  {
  
  
      char str[51] = "Test String";
      char test[50] = "";
      char word1[20] = "";
      //char * word2;
      char word3[20] = "";
      char word4[20] = "";
      system("cls");
      scanf("%50[0-9a-zA-Z ]", &amp;test);
      flushall();
      strcpy(word3, strtok(test, " ,.-"));
      int cray;
      for (bool correctI = false; correctI == false;)
      {
  
          if (word3 != NULL)
          {
              strcpy(word1, strtok(NULL, " ,.-"));
              cray = strcmp(word1, NULL);//Error thrown here
              if (cray != 0)
              {
                  strcpy(word4, word1);
  
              }
          }
          printf("%s", word3);
          printf("%s", word4);
          cray = stricmp(word1, "Items");
          if (cray = 0)
          {
              printf("Success!!");
  
          }
          else
          {
              printf("Fail");
          }
      }
      _getch();
  
  
  }
  
  //TODO: use stricmp()
  </code></pre>
  
  <p>I am runing into trouble in the text parser function.</p>