title: Bubble Sort using C++
body: <p>I am attempting to bubble sort the values in the array "A" using c++, but get error saying stack around variable A is corrupted?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  int main()
  {
      int A[] = {5,7,8,2,4,3};
  
      for (int i = 1; i &lt;= 7 - 1; i++)
      {
          for (int j = 7; j &gt;= i + 1; j--)
          {
              if (A[j] &lt; A[j - 1])
              {
                  swap(A[j], A[j - 1]);
              }
          }
      }
  }
  </code></pre>