title: In a LinkedList program I get an Exception saying that large string mode is engaged
body: <p>here is code: </p>
  
  <pre><code>    #include &lt;iostream&gt;
      #include &lt;string&gt;
      using namespace std;
          struct node
      {
          string program;
          node *next;
      }    
  
  bool isEmpty(node *head)
  {
      if (head == NULL)
          return true;
      else
          return false;
  }
  
  void insertAsFirstElement(node *&amp;head, node *&amp;tail, string program)
  {
      node *temp = new node;
      temp-&gt;program = program;
      temp-&gt;next = NULL;
      head = temp;
      tail = temp;
  
  }
  
  void initialize(node *&amp;head, node *&amp;tail, string program)
  {
      if (isEmpty(head))
          insertAsFirstElement(head, tail, program);
      else
      {
          node* temp = new node;
          temp-&gt;program = program;
          temp-&gt;next = NULL;
          tail-&gt;next = temp;
          tail = temp;
      }
  }
  
  void showList(node *current)
  {
      if (isEmpty(current))
          cout &lt;&lt; "The list is empty. \n";
      else
      {
          int i = 0;
          cout &lt;&lt; "The list contains: \n";
          while(current != NULL)
              {
                  cout &lt;&lt; current-&gt;program &lt;&lt; " ";
                  if ((i + 1) % 8 == 0)
                      cout &lt;&lt; "\n";
                  current = current-&gt;next;
                  i++;
              }
      }
  }
  int main()
  {
      node *head = NULL;
      node *tail = NULL;
      for (int i = 0; i &lt;= 31; i++)
      {
          initialize(head, tail, "FREE");
      }
      showList(head);
      return 0;
  }
  </code></pre>
  
  <p>The program has been working fine until now, but for some reason that I don't understand now when I run it it's throwing this exception "large string mode (allocated memory) is engaged"</p>
  
  <p>In the show list the I included the second if statement only because it was a part of the assignment </p>
  
  <pre><code>bool _Large_string_engaged() const
          {   // returns whether the large string mode (allocated memory) is engaged
          return (this-&gt;_BUF_S_SIZE &lt;= _Myres);
      }
  </code></pre>
  
  <p>This is the exception I can't figure out how to write code in the comments.</p>
  
  <p>You mean all this:</p>
  
  <pre><code>Project4.exe!std::_String_val&lt;std::_Simple_types&lt;char&gt; &gt;::_Myptr() Line 1621
      Project4.exe!std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;::_Inside(const char * const _Ptr) Line 3590   
      Project4.exe!std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;::assign(const char * const _Ptr, const unsigned __int64 _Count) Line 2413 
      Project4.exe!std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;::assign(const char * const _Ptr) Line 2430    
      Project4.exe!std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;(const char * const _Ptr) Line 1982   
  &gt;   Project4.exe!main() Line 84 
  </code></pre>