title: Command line argument validation in C
body: <p>I have a program that needs to get an <code>int</code> from the user from the command line </p>
  
  <pre><code>int main(int argc, char* argv[])
  </code></pre>
  
  <p>My only problem is that I need to check whether <code>argv</code> is an <code>int</code>. If it isn't, I need to return an error. How can I do that? I have to check if the input is an <code>int</code> before using <code>atoi</code>. Can someone help me?</p>