title: what do i do with throw to handle wrong data type in c++
body: <p>so I am trying am trying to convert a integer to hexadecimal and i am placing a non int type into the input variable as well as a negative number. when i do add the throw code it flops. without the throw it will loop forever. Am i throwing the wrong throw argument? how would my if statement handle non int types such as a, b car into the num variable?</p>
  
  <pre><code>cout&lt;&lt;"please enter integer number to be converted to binary (less than 65536) "&lt;&lt;endl;
      cin&gt;&gt;num; 
  if (num &lt;=0)
  {
     throw invalid_argument("wrong input");
  }
  else
  cout &lt;&lt; num + 1;
  </code></pre>