title: Throwing a const char* in a Try-Catch block
body: <p>In my code I want to throw a message, so it appears in screen when an input is spotted. I wanted to do this way, but it did not work. So, I would like your help to see if is there anything that I don't know, or if it is an illegal action in C++.</p>
  
  <p>This is where in my code the throw appears (a class function-member implementation)</p>
  
  <pre><code>//set the value of _s (seconds)
  void Time::setSeconds(int s){
      if (s &gt; 60 || s &lt; 0)
          throw ("The value inside seconds has to be valid");
      else
          _s = s;
  }
  </code></pre>
  
  <p>And this is how I manage to make a simple try-catch block</p>
  
  <pre><code>try{
      Time t(12,4,-12);
  
      t.printStandard();
  
      }catch(string const &amp;a){
          cerr &lt;&lt; a;
      }
  </code></pre>
  
  <p>However, when the program is run, I get the following error message:</p>
  
  <pre><code>terminate called after throwing an instance of 'char const*'
  Aborted (core dumped)
  </code></pre>
  
  <p>Which is obviously not the intended.</p>