title: accepting multiple strings as input in c++
body: <p>I am getting the following error when i try to enter the second query as input by pressing 'y' when asked for "Do you want to enter more queries? Enter (y/n)" in my code:</p>
  
  <p>terminate called after throwing an instance of 'std::out_of_range'
    what():  basic_string::substr
  Aborted (core dumped)</p>
  
  <p>My code is: </p>
  
  <pre><code>#define SIZE 100
  
  #include "SQLParser.cpp"
  
  
  
  using namespace std;
  
  
  
  int main() {
  
  
  
      string s[SIZE];
  
      SQLParser parser;
      char in;
      int i=0;
  
      cout&lt;&lt;"Enter the input queries:";
  
      do
      {
      //try
      //{
          std::getline(std::cin,s[i],'\n');
      //cin.ignore(100000, '\n');
  
      //cout&lt;&lt;" "&lt;&lt;s[i]&lt;&lt;"\n";
  
      parser[i].sql=s[i];
  
      parser[i].ProcessSQL();
  
      cout&lt;&lt;"Do you want to enter more queries? Press (y/n):";
  
      cin&gt;&gt;in;
  
      cin.ignore(100000, '\n');
  
      i++;
  
      //}
      /*catch (std::exception const &amp;exc)
      {
              std::cerr &lt;&lt; "Exception caught " &lt;&lt; exc.what() &lt;&lt; "\n";
      }*/
  
      }while(in!='n');
  
      /*string s("CREATE TABLE tab(aa int,bb string, cc string)");
  
      string s1("CREATE TABLE xyz(name string,gender char,age int,address string)");
      parser.sql=s;
  
      //parser1.sql=s1;
      string s2("INSERT INTO tab(name,author,date) VALUES ('aa','bb','cc')");
  
      //parser.sql = s2;
  
      parser.ProcessSQL();
      parser.sql = s1;
      parser.ProcessSQL();
  
      */
  
      return 1;
  }
  </code></pre>
  
  <p>Please help what is the issue with my code.</p>