title: Strange gdb c++ error
body: <p>I am making a commandline program in C++ and have run into some strange problems.
  I am very new to C++, so this is probably why I am so baffled.
  I am using MinGW to compile and debug.</p>
  
  <p>Here is the current code:</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;vector&gt;
  #include &lt;iostream&gt;
  #include &lt;stdlib.h&gt; 
  
  using namespace std;
  
  // Global Vars
  string headerSpace = "\t\t";
  string instructionSpace = "\t";
  string prmpt = "WIO:+&gt;";
  string daysOFWeek [7] = {"mon", "tue", "wed", "thur", "fri", "sat", "sun"};
  
  vector&lt;string&gt; commandHelpGet ("To view a day's exercises type:: get (date)\n", "To view today's required exercises type:: get required\n");
  vector&lt;string&gt; commandHelpRem ( "To clear a day's record type:: remove (date)\n", "To remove an exercise from your routine type:: remove (name)\n");
  vector&lt;string&gt; commandHelpRec ("To record a day's exercises type:: record (date)\n");
  vector&lt;string&gt; commandHelpAdd ("To add an exercise to your routine type:: add (name) (rep/min) (daysOFWeek)\n");
  
  
  
  
  // Method prototypes 
  vector&lt;string&gt; splitString(string input, string splitter);
  void processGetCom(vector&lt;string&gt; input);
  void processRecordCom(vector&lt;string&gt; input);
  void processRemoveCom(vector&lt;string&gt; input);
  void processAddCom(vector&lt;string&gt; input);
  void help(string context);
  void printError(string reason);
  string requiredExercises();
  string getRecord(string input);
  
  
  int main()
  {
      cout &lt;&lt; "\n\n" + headerSpace + "---------- Welcome to WorkItOut! ----------\n";
      help("");
      string inRaw = "";
      vector&lt;string&gt; input;
      while (true)
      {
          cout &lt;&lt; prmpt; 
          string inRaw = "";
          getline(cin, inRaw);
          input = splitString(inRaw, " ");
  
          // Overflow guard
          if (input.size() &gt; 4)
          {
              printError("To many arguments; Please enter a valid command");
          }
  
          if (input[0].compare("get") == 0)
          {
              processGetCom(input);
          }
          else if (input[0].compare("record") == 0)
          {
              processRecordCom(input);
          }
          else if (input[0].compare("remove") == 0)
          {
              processRemoveCom(input);
          }
          else if (input[0].compare("add") == 0)
          {
              processAddCom(input);
          }
          else if (input[0].compare("exit") == 0)
          {
              exit(0);
          }
      }
  }
  
  
  /* Updated C. A. Acred on 05/22/2015
   * This method takes a string and splits it into a vector with the second input.
   */
  vector&lt;string&gt; splitString(string input, string splitter)
  {
      vector&lt;string&gt; output; // initialize output vector
      int currentElement = 0; // set current vector element to 0
      string currentChar; // declare a container for the current char
      output.push_back(""); // Push an empty string onto output
      for(int i = 0; i &lt; input.length(); i++) // for each char in input
      {
          currentChar = input.substr(i, 1); // currentChar = the char in input @ i
          if (currentChar.compare(splitter) == 0) // if this char and the splitter are the same
          {
              while (currentChar.compare(splitter) == 0) // while they are the same
              {
                  i++; // advance i by 1
                  currentChar = input.substr(i, 1); // get the next char
              }
              output.push_back(currentChar); // put the current char as the first in a new element
              currentElement++; // point to the new element
          }
          else
          {
              output[currentElement] = output[currentElement] + currentChar; // output @ currentElement += currentChar
          }
      }
      return output;
  }
  
  string requiredExercises()
  {
      return "yo";
  }
  
  
  /* Updated C. A. Acred on 5/27/15
   * Processes get commands.
   */
  void processGetCom(vector&lt;string&gt; input)
  {
      if (input.size() &gt; 2)
      {
          printError("To many arguments; Enter a valid command");
      }
  
      if (input[1].compare("required") == 0)
      {
          cout &lt;&lt; requiredExercises();
      }
      else
      {
          cout &lt;&lt; getRecord(input[1]);
      }
  }
  
  void processRecordCom(vector&lt;string&gt; input)
  {
  
  }
  
  void processRemoveCom(vector&lt;string&gt; input)
  {
  
  }
  
  void processAddCom(vector&lt;string&gt; input)
  {
  
  }
  
  void printError(string reason)
  {
  
  }
  
  
  /** Updated C. A. Acred 05/22/2015
   * Print help on commands.
   */
  void help(string context)
  {
      if (context.empty())
      {
          int i;
          for (i = 0; i &lt; commandHelpGet.size(); i++)
          {
              cout &lt;&lt; commandHelpGet[i];
          }
          for (i = 0; i &lt; commandHelpRec.size(); i++)
          {
              cout &lt;&lt; commandHelpRec[i];
          }
          for (i = 0; i &lt; commandHelpRem.size(); i++)
          {
              cout &lt;&lt; commandHelpRem[i];
          }
          for (i = 0; i &lt; commandHelpAdd.size(); i++)
          {
              cout &lt;&lt; commandHelpAdd[i];
          }
      }
      cout &lt;&lt; instructionSpace + "To exit type:: exit\n";
      cout &lt;&lt; instructionSpace + "-+| date format = m/d/yr |+-\n\t\tExample:: 05/20/2015\n";
      cout &lt;&lt; instructionSpace + "-+| daysOFWeek format = day/day/day..etc(up to 7) |+-\n\t\tExample:: mon/tue/wed/thur/fri/sat/sun\n\n\n\n";
      cout &lt;&lt; instructionSpace + "-+| rep format = rep:(#) |+-\n\t\tExample:: rep:15\n\n\n\n";
      cout &lt;&lt; instructionSpace + "-+| min format = min:(#) |+-\n\t\tExample:: min:15\n\n\n\n";
  }
  </code></pre>
  
  <p>And here is the strange error I am getting from g++:</p>
  
  <pre><code>main.cpp:24:84: error: invalid conversion from 'const char*' to 'unsigned int' [-fpermissive]
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_vector.h:263:7: error:   initializing argument 1 of 'std::vector&lt;_Tp, _Alloc&gt;::vector(std::vector&lt;_Tp, _Alloc&gt;::size_type, const value_type&amp;, const allocator_type&amp;) [with _Tp = std::basic_string&lt;char&gt;, _Alloc = std::allocator&lt;std::basic_stri
  ng&lt;char&gt; &gt;, std::vector&lt;_Tp, _Alloc&gt;::size_type = unsigned int, std::vector&lt;_Tp, _Alloc&gt;::value_type = std::basic_string&lt;char&gt;, std::vector&lt;_Tp, _Alloc&gt;::allocator_type = std::allocator&lt;std::basic_string&lt;char&gt; &gt;]' [-fpermissive]
  main.cpp:25:111: error: invalid conversion from 'const char*' to 'unsigned int' [-fpermissive]
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_vector.h:263:7: error:   initializing argument 1 of 'std::vector&lt;_Tp, _Alloc&gt;::vector(std::vector&lt;_Tp, _Alloc&gt;::size_type, const value_type&amp;, const allocator_type&amp;) [with _Tp = std::basic_string&lt;char&gt;, _Alloc = std::allocator&lt;std::basic_stri
  ng&lt;char&gt; &gt;, std::vector&lt;_Tp, _Alloc&gt;::size_type = unsigned int, std::vector&lt;_Tp, _Alloc&gt;::value_type = std::basic_string&lt;char&gt;, std::vector&lt;_Tp, _Alloc&gt;::allocator_type = std::allocator&lt;std::basic_string&lt;char&gt; &gt;]' [-fpermissive]
  In file included from c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/vector:63:0,
                   from main.cpp:10:
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_construct.h: In function 'void std::_Construct(_T1*, const _T2&amp;) [with _T1 = std::basic_string&lt;char&gt;, _T2 = char]':
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_uninitialized.h:77:3:   instantiated from 'static _ForwardIterator std::__uninitialized_copy&lt;_TrivialValueTypes&gt;::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const char*, _ForwardIterator = std::bas
  ic_string&lt;char&gt;*, bool _TrivialValueTypes = false]'
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_uninitialized.h:119:41:   instantiated from '_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const char*, _ForwardIterator = std::basic_string&lt;char&gt;*]'
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_uninitialized.h:259:63:   instantiated from '_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator&lt;_Tp&gt;&amp;) [with _InputIterator = const char*, _ForwardIterator = std::basic_string&lt;char&gt;*
  , _Tp = std::basic_string&lt;char&gt;]'
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_vector.h:1113:4:   instantiated from 'void std::vector&lt;_Tp, _Alloc&gt;::_M_range_initialize(_ForwardIterator, _ForwardIterator, std::forward_iterator_tag) [with _ForwardIterator = const char*, _Tp = std::basic_string&lt;char&gt;, _Alloc = std::alloca
  tor&lt;std::basic_string&lt;char&gt; &gt;]'
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_vector.h:1091:4:   instantiated from 'void std::vector&lt;_Tp, _Alloc&gt;::_M_initialize_dispatch(_InputIterator, _InputIterator, std::__false_type) [with _InputIterator = const char*, _Tp = std::basic_string&lt;char&gt;, _Alloc = std::allocator&lt;std::ba
  sic_string&lt;char&gt; &gt;]'
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_vector.h:340:4:   instantiated from 'std::vector&lt;_Tp, _Alloc&gt;::vector(_InputIterator, _InputIterator, const allocator_type&amp;) [with _InputIterator = const char*, _Tp = std::basic_string&lt;char&gt;, _Alloc = std::allocator&lt;std::basic_string&lt;char&gt; &gt;
  , std::vector&lt;_Tp, _Alloc&gt;::allocator_type = std::allocator&lt;std::basic_string&lt;char&gt; &gt;]'
  main.cpp:22:140:   instantiated from here
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_construct.h:84:7: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/basic_string.tcc:214:5: error:   initializing argument 1 of 'std::basic_string&lt;_CharT, _Traits, _Alloc&gt;::basic_string(const _CharT*, const _Alloc&amp;) [with _CharT = char, _Traits = std::char_traits&lt;char&gt;, _Alloc = std::allocator&lt;char&gt;]' [-fpermiss
  ive]
  </code></pre>
  
  <p>Any help with understanding and fixing this error is most appreciated.</p>
  
  <h2>UPDATE #1:</h2>
  
  <p>I changed the initialization of the vectors commandHelpGet - commandHelpAdd to use curly braces, but now I get a new error:</p>
  
  <pre><code>main.cpp:22:16: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x [enabled by default]
  main.cpp:22:139: error: in C++98 'commandHelpGet' must be initialized by constructor, not by '{...}'
  main.cpp:23:16: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x [enabled by default]
  main.cpp:23:147: error: in C++98 'commandHelpRem' must be initialized by constructor, not by '{...}'
  main.cpp:24:16: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x [enabled by default]
  main.cpp:24:84: error: in C++98 'commandHelpRec' must be initialized by constructor, not by '{...}'
  main.cpp:24:84: error: invalid conversion from 'const char*' to 'unsigned int' [-fpermissive]
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_vector.h:263:7: error:   initializing argument 1 of 'std::vector&lt;_Tp, _Alloc&gt;::vector(std::vector&lt;_Tp, _Alloc&gt;::size_type, const value_type&amp;, const allocator_type&amp;) [with _Tp = std::basic_string&lt;char&gt;, _Alloc = std::allocator&lt;std::basic_stri
  ng&lt;char&gt; &gt;, std::vector&lt;_Tp, _Alloc&gt;::size_type = unsigned int, std::vector&lt;_Tp, _Alloc&gt;::value_type = std::basic_string&lt;char&gt;, std::vector&lt;_Tp, _Alloc&gt;::allocator_type = std::allocator&lt;std::basic_string&lt;char&gt; &gt;]' [-fpermissive]
  main.cpp:25:16: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x [enabled by default]
  main.cpp:25:111: error: in C++98 'commandHelpAdd' must be initialized by constructor, not by '{...}'
  main.cpp:25:111: error: invalid conversion from 'const char*' to 'unsigned int' [-fpermissive]
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_vector.h:263:7: error:   initializing argument 1 of 'std::vector&lt;_Tp, _Alloc&gt;::vector(std::vector&lt;_Tp, _Alloc&gt;::size_type, const value_type&amp;, const allocator_type&amp;) [with _Tp = std::basic_string&lt;char&gt;, _Alloc = std::allocator&lt;std::basic_stri
  ng&lt;char&gt; &gt;, std::vector&lt;_Tp, _Alloc&gt;::size_type = unsigned int, std::vector&lt;_Tp, _Alloc&gt;::value_type = std::basic_string&lt;char&gt;, std::vector&lt;_Tp, _Alloc&gt;::allocator_type = std::allocator&lt;std::basic_string&lt;char&gt; &gt;]' [-fpermissive]
  In file included from c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/vector:63:0,
                   from main.cpp:10:
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_construct.h: In function 'void std::_Construct(_T1*, const _T2&amp;) [with _T1 = std::basic_string&lt;char&gt;, _T2 = char]':
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_uninitialized.h:77:3:   instantiated from 'static _ForwardIterator std::__uninitialized_copy&lt;_TrivialValueTypes&gt;::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const char*, _ForwardIterator = std::bas
  ic_string&lt;char&gt;*, bool _TrivialValueTypes = false]'
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_uninitialized.h:119:41:   instantiated from '_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const char*, _ForwardIterator = std::basic_string&lt;char&gt;*]'
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_uninitialized.h:259:63:   instantiated from '_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator&lt;_Tp&gt;&amp;) [with _InputIterator = const char*, _ForwardIterator = std::basic_string&lt;char&gt;*
  , _Tp = std::basic_string&lt;char&gt;]'
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_vector.h:1113:4:   instantiated from 'void std::vector&lt;_Tp, _Alloc&gt;::_M_range_initialize(_ForwardIterator, _ForwardIterator, std::forward_iterator_tag) [with _ForwardIterator = const char*, _Tp = std::basic_string&lt;char&gt;, _Alloc = std::alloca
  tor&lt;std::basic_string&lt;char&gt; &gt;]'
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_vector.h:1091:4:   instantiated from 'void std::vector&lt;_Tp, _Alloc&gt;::_M_initialize_dispatch(_InputIterator, _InputIterator, std::__false_type) [with _InputIterator = const char*, _Tp = std::basic_string&lt;char&gt;, _Alloc = std::allocator&lt;std::ba
  sic_string&lt;char&gt; &gt;]'
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_vector.h:340:4:   instantiated from 'std::vector&lt;_Tp, _Alloc&gt;::vector(_InputIterator, _InputIterator, const allocator_type&amp;) [with _InputIterator = const char*, _Tp = std::basic_string&lt;char&gt;, _Alloc = std::allocator&lt;std::basic_string&lt;char&gt; &gt;
  , std::vector&lt;_Tp, _Alloc&gt;::allocator_type = std::allocator&lt;std::basic_string&lt;char&gt; &gt;]'
  main.cpp:22:139:   instantiated from here
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_construct.h:84:7: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
  c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/basic_string.tcc:214:5: error:   initializing argument 1 of 'std::basic_string&lt;_CharT, _Traits, _Alloc&gt;::basic_string(const _CharT*, const _Alloc&amp;) [with _CharT = char, _Traits = std::char_traits&lt;char&gt;, _Alloc = std::allocator&lt;char&gt;]' [-fpermiss
  ive]
  </code></pre>
  
  <p>- CAA14</p>