Check if there are more than 1 argument <p>I have a simple program that encrypts message using <code>Caesar Cipher</code>.</p> <p>The program works well, but I am unable to check whether the user is entering more than 1 argument. If he is, I need to break and prompt the user to enter the correct number of arguments which is <code>1</code>.</p> <p>If you enter more than 1 argument in terminal, say <code>./caesar 13 56 hello</code> it will still work but it shouldn't</p> <pre><code>int main(int argc, string argv[]) { int indexKey = 0; string message; if (argc &lt; 2 || atoi(argv[0]) &lt; 0 || atoi(argv[1]) &lt; 0) { printf("Please enter a non-negative integer as an argument.\n"); return 1; } else { indexKey = atoi(argv[1]); } </code></pre> <p>How do I prevent the user from entering too many arguments?</p>