title: Switch statement : if input not a digit (1 to 9) or a letter (a to z) output << "error" ? C++
body: <p>How can I output an "error" message if the input is not a letter from a to z or a digit from 1 to 9.
  For exemple, if the user inputs '%', how can I output "error" ?</p>
  
  <p>I tried this :    </p>
  
  <pre><code>if ((name.letter &lt;= a) &amp;&amp; (name.letter &gt;= z)) {
     cout &lt;&lt; "error";
  } 
  </code></pre>
  
  <p>but I guess it's just not C++ code...</p>