0

so i'm in quite a bind with the ceaser problem set. I'm trying to confirm if the second command line argument is a number using the if-else statement below and the code keeps on choosing the 'else' option. I've converted the string argument with the 'atoi' function sooo help pls lolenter image description here

  • 2
    You should post your code as text, using the code tags. Otherwise people can't copy-paste from it or try to run it themselves. – Dave S Jul 09 '21 at 18:04

1 Answers1

0

From the Microsoft C++ Docs:

By convention, argv[0] is the command with which the program is invoked. argv[1] is the first command-line argument. The last argument from the command line is argv[argc - 1], and argv[argc] is always NULL.

The second command line argument would be argv[2] and your argc should equal 3.

Viet Than
  • 164
  • 1
  • 10