title: Exception thrown: read access violation. it was 0xFDFDFDFD
body: <p>I'm beginner in C and data structures, and getting a frustrating exception. I've compared with other doubly linked list codes but couldn't find the mistake.</p>
  <p>While debuging the code, I get a warning about a read access violation from stdio.h and this is the troubled part:</p>
  <blockquote>
  <p>return __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Stream, _Format, _Locale, _ArgList);</p>
  </blockquote>
  <p>Could you help me please?</p>
  <pre><code>struct Node* NewNode() {
  
      struct Node* new_node = (struct Node*)malloc(sizeof(struct Node*));
      new_node-&gt;next = NULL;
      new_node-&gt;prev = NULL;
      return new_node;
  
  }
  
  void InsertElement(char con, char name[51]) {
  
      struct Node* new_node = NewNode();
      strcpy(new_node-&gt;name,name);
      
      if (head == NULL) {
          head = new_node;
          tail = head;
          return;
      }
      
      if (con == 'H') {
          head-&gt;prev = new_node;
          new_node-&gt;next = head;
          head = new_node;
      }
      
      else if (con == 'T') {
          tail-&gt;next = new_node;
          new_node-&gt;prev = tail;
          tail = new_node;
      }
  
  }
  
  void DisplayForward() {
  
      if (head == NULL) {
          printf(&quot;No Songs To Print\n*****\n&quot;);
          return;
      }
      struct Node *temp = head;
      while (temp != NULL) {
          printf(&quot;%s\n&quot;, temp-&gt;name);
          temp = temp-&gt;next;
      }
      printf(&quot;*****\n&quot;);
  }
  
  void DisplayReversed() {
  
      if (head == NULL) {
          printf(&quot;No Songs To Print\n*****\n&quot;);
          return;
       }
      
      struct Node *temp = tail;
      while (temp != NULL) {
          printf(&quot;%s\n&quot;, temp-&gt;name);
          temp = temp-&gt;prev;
      }
      printf(&quot;*****\n&quot;);
  
  }
  </code></pre>