title: *** glibc detected *** ./a.out: double free or corruption (out): 0xbfe69600 ***
body: <p>I'm doing a program to represent a table of "Students". It has the attributes 'ID', 'First Name' and 'Last Name'. I did a two-dimensional array and put cout statements all throughout to check... The correct info IS stored in the correct cell, but I get an error I don't recognize.
  the code for the .cpp file is:</p>
  
  <pre><code>#include "Table1.h"
  #include &lt;sstream&gt;
  #include &lt;iostream&gt;
  using namespace std;
  
  Table1::Table1(){
  
  RowPos = 1;
  ColPos = 0;
  
  for(int i=1; i&lt;16; i++)
  {
      for(int j=0; j&lt;3 ; j++)
  
          Students[i][j] = "FakeNull"; // fill the array with Null value
      }
  }
  
  string Table1::InsertStudent(string ID, string FN, string LN){
  
      Students[0][0] = "StudentID";
      Students[0][1] = "FirstName";
      Students[0][2] = "LastName";
  
  
      Students[RowPos][ColPos] = ID; //Assign ID to first column
      ColPos++; //Move to next column
      Students[RowPos][ColPos] = FN;
      ColPos++;
      Students[RowPos][ColPos] = LN;
      ColPos++;
  
      ColPos = 0;
      RowPos++;
  }
  
  void Table1::Print(string Name){
  
      if(Name == "students"){
  
          for(int i=1; i&lt;16; i++)
          {
              int j=0;
              if(Students[i][j] == "FakeNull")
                      break;
              else
                  cout&lt;&lt; "("&lt;&lt; Students[i][j]&lt;&lt; ",";
                  j++;
                  cout&lt;&lt; Students[i][j]&lt;&lt; ",";
                  j++;
                  cout&lt;&lt; Students[i][j]&lt;&lt; ")";
  
          }
  
  
      }
  }
  </code></pre>
  
  <p>My Table1.h is:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  #include &lt;string&gt;
  
  
  #ifndef GRADE_HEADER
  #define GRADE_HEADER
  class Table1
  
  private:
  
      string Students[16][3];
  
      string Grades[16][3];
      int RowPos;
      int ColPos;
  
  public:
      Table1();
      string InsertStudent(string, string, string);
      string InsertGrade(string, string, string, string);
      void Print(string);
      void Select(string, string, int);
      void Select(string, string, string);
      void Select(string, string, char);
      void Join();
      string Converter(int);
  
  
  };
  #endif
  </code></pre>
  
  <p>The ERROR is the following:</p>
  
  <pre><code>    *** glibc detected *** ./a.out: double free or corruption (out): 0xbfbdeae0 ***
      ======= Backtrace: =========
      /lib/i386-linux-gnu/libc.so.6(+0x75ee2)[0xeadee2]
      /usr/lib/i386-linux-gnu/libstdc++.so.6(_ZdlPv+0x1f)[0x9a951f]
      /usr/lib/i386-linux-gnu/libstdc++.so.6(_ZNSs4_Rep10_M_destroyERKSaIcE+0x1b)          [0x99099b]
      /usr/lib/i386-linux-gnu/libstdc++.so.6(+0x909dc)[0x9909dc]
      /usr/lib/i386-linux-gnu/libstdc++.so.6(_ZNSsD1Ev+0x2e)[0x990a4e]
      ./a.out[0x8049299]
      /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0xe514d3]
      ./a.out[0x8048a71]
      ======= Memory map: ========
      003a0000-003ca000 r-xp 00000000 08:01 150255     /lib/i386-linux-gnu/libm-2.15.so
      003ca000-003cb000 r--p 00029000 08:01 150255     /lib/i386-linux-gnu/libm-2.15.so
      003cb000-003cc000 rw-p 0002a000 08:01 150255     /lib/i386-linux-gnu/libm-2.15.so
      005a5000-005a6000 r-xp 00000000 00:00 0          [vdso]
      007c5000-007e5000 r-xp 00000000 08:01 150250     /lib/i386-linux-gnu/ld-2.15.so
      007e5000-007e6000 r--p 0001f000 08:01 150250     /lib/i386-linux-gnu/ld-2.15.so
      007e6000-007e7000 rw-p 00020000 08:01 150250     /lib/i386-linux-gnu/ld-2.15.so
      00900000-009d8000 r-xp 00000000 08:01 393409     /usr/lib/i386-linux gnu/libstdc++.so.6.0.16
      009d8000-009d9000 ---p 000d8000 08:01 393409     /usr/lib/i386-linux gnu/libstdc++.so.6.0.16
      009d9000-009dd000 r--p 000d8000 08:01 393409     /usr/lib/i386-linux gnu/libstdc++.so.6.0.16
      009de000-009e5000 rw-p 00000000 00:00 0
      00c13000-00c2f000 r-xp 00000000 08:01 132412     /lib/i386-linux-gnu/libgcc_s.so.1
      00c2f000-00c30000 r--p 0001b000 08:01 132412     /lib/i386-linux-gnu/libgcc_s.so.1
      00c30000-00c31000 rw-p 0001c000 08:01 132412     /lib/i386-linux-gnu/libgcc_s.so.1
      00e38000-00fdc000 r-xp 00000000 08:01 150260     /lib/i386-linux-gnu/libc-2.15.so
      00fdc000-00fde000 r--p 001a4000 08:01 150260     /lib/i386-linux-gnu/libc-2.15.so
      00fde000-00fdf000 rw-p 001a6000 08:01 150260     /lib/i386-linux-gnu/libc-2.15.so
      00fdf000-00fe2000 rw-p 00000000 00:00 0
      08048000-0804a000 r-xp 00000000 00:19 52698567   
      0804a000-0804b000 r--p 00001000 00:19 52698567   
      0804b000-0804c000 rw-p 00002000 00:19 52698567   
      09df7000-09e18000 rw-p 00000000 00:00 0          [heap]
      b77c9000-b77cc000 rw-p 00000000 00:00 0
      b77de000-b77e3000 rw-p 00000000 00:00 0
      bfbbe000-bfbdf000 rw-p 00000000 00:00 0          [stack]
      Aborted (core dumped)
  </code></pre>