title: C Programming strcat.asm not found error debugging
body: <p>I am working on a homework assignment and have been attempting to debug my program, but to no avail. I am trying to read in an input file then add each char to the end of a linked list, but my program keeps crashing and says strcat.asm not found, as well as "Unhandled exception at 0x0FA74127 (msvcr120d.dll) in... writing location 0x00000000000000" which from looking at other questions on here appears to be a problem with a NULL pointer. After 3 hours of dealing with this single problem I am turning to you all for help, thank you.
  This is the full code:</p>
  
  <pre><code>    #include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  
  #define LENGTH 80
  
  struct boggleDataNode {
      char data[3];
      struct boggleDataNode *nextData;
  };
  
  void readData(struct boggleDataNode **);
  struct boggleDataNode* makeNode(char *);
  void display(struct boggleDataNode *);
  
  int main() {
      struct boggleDataNode * head = NULL;
      readData(&amp;head);
      display(head);
  }
  
  void readData(struct boggleDataNode **headRef){
      //initializing variables including
      //opening the input file
      char dataLine[LENGTH];
      char *data;
      char *fileName = "BoggleData.txt";
  
      FILE *filePointer;
  
      printf("Trying to open file %s\n", fileName);
      filePointer = fopen(fileName, "r"); //read mode
      printf("Successfully opened file %s\n", fileName);
  
      if (filePointer == NULL){
          perror("Error while opening file. \n");
          exit(0);
      }
  
      //loop until find end of file
      while (fgets(dataLine, LENGTH, filePointer) != NULL){
          for (char *tok = strtok(dataLine, " "); tok; tok = strtok(NULL, " "))
          {
              data = tok;
              printf("data = %s\n", tok);
              if (*headRef == NULL){
                  *headRef = makeNode(data);
                  head = *headRef;
              }
              else{
                  head-&gt;nextData = makeNode(data);
                  head = head-&gt;nextData;
              }
          }
      }
  
      fclose(filePointer);
  
  }//close readData
  
  struct boggleDataNode* makeNode(char *data){
      struct boggleDataNode* temp = (struct boggleDataNode*) malloc(sizeof(struct boggleDataNode));
      strcpy(temp-&gt;data, data);
      temp-&gt;nextData = NULL;
      return temp;
  
      /*
      //allocate node
      struct boggleDataNode* temp = (struct boggleDataNode*) malloc(sizeof(struct boggleDataNode));
      struct boggleDataNode* right = (struct boggleDataNode*) malloc(sizeof(struct boggleDataNode));
  
      if ((*headRef) == NULL){
      strcpy((*headRef)-&gt;data, data);
      (*headRef)-&gt;nextData = NULL;
      }
      else{
      strcpy(temp-&gt;data, data);
      temp-&gt;nextData = NULL;
  
      // ======== The program appears to break here ================
      right = (*headRef);
      while (right-&gt;nextData != NULL)
      right = right-&gt;nextData;
  
      right-&gt;nextData = temp;
      right = temp;
      right-&gt;nextData = NULL;
      }
      }  */
  }
  
  void display(struct boggleDataNode *headRef){
  
      struct boggleDataNode *helper = headRef;
  
      if (helper == NULL){
          return;
      }
      else{
          printf("============================================\n");
          printf("Node #        Data\n");
          printf("============================================\n");
  
          int counter = 1;
  
          while (helper != NULL){
              printf("%5d \t %2s\n", counter++, helper-&gt;data);
              helper = helper-&gt;nextData;
          }
      }
      printf("\n");
  }
  </code></pre>
  
  <p>This is the input file</p>
  
  <pre><code>D R L X E I
  C P O H S A
  N H N L Z R
  W T O O T A
  I O S S E T 
  N W E G H E
  B O O J A B
  U I E N E S
  P S A F K F
  I U N H M Qu
  Y R D V E L
  V E H W H R
  I O T M U C
  T Y E L T R
  S T I T Y D
  A G A E E N
  </code></pre>