title: debug assertion failed! (c++)
body: <p>I am trying to create a program that analyzes an inputted word to see if it is a palindrome or not.</p>
  
  <p>I'm doing this bit by bit, and this is my code so far:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  int main(string word) {
  cout &lt;&lt; "Word: ";
  cin &gt;&gt; word;
  bool x = true;
  int length = word.length();
  int k = length;
      int y = 0;
      for (int i = length-1; i &gt;= 0; i--) {
              int j = k - 1;
              int l = i - j;
              char a = word[i];
              char b = word[l];
              cout &lt;&lt; "a: " &lt;&lt; a &lt;&lt; "     b: " &lt;&lt; b &lt;&lt; endl;
              k = k - 2;
      }
      return 0;
  }
  </code></pre>
  
  <p>It produces the output I want:</p>
  
  <pre><code>Word: marcus
  a: s       b: m
  a: u       b: a
  a: c       b: r
  a: r       b: c
  a: a       b: u
  a: m       b: s
  </code></pre>
  
  <p>But every time I run it, it gives me this error:</p>
  
  <blockquote>
    <p>Debug Assertion Failed! Line: 106</p>
    
    <p>Expression: "(_Ptr_user &amp; (_BIG_ALLOCATION_ALIGNMENT - 1))) == 0" &amp;&amp; 0</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>