title: C Trying to check for invalid input
body: <p>I'm using <code>scanf("%s", u);</code> so I take a string. I can take the characters <code>q</code>, <code>c</code>, <code>-</code>, <code>+</code>, <code>/</code>, <code>*</code>, <code>%</code>, <code>^</code>, <code>=</code>, and integers, but for everything else I want my program to display an error message. How would I know if it's any other character, because if they put anything other than those it will go into an if statement that assumes it's an integer in a string and <code>atoi()</code> it which then equals 0 and spoils things.</p>