I'm having trouble verifying the argv[1]
keyword along the guidelines of the assignment.
I've tried to implement an if ... else
statement the checks if argc
is 2 and argv[1]
is alpha, if so, run the cipher, otherwise return 1
. The problem was twofold:
- When I had the
if ... else
there, the cipher wouldn't work with check50, even though it would without the cipher. It gave the error: "expected prompt for input, not standard error of "/opt/sandbox50/bin/run.sh: line 31: 7 (or 6 depending on the input in check50)..."
" isalpha
doesn't work with strings, and the implementation of afor
loop made the rest of the verification not work. The errors in check50 with this implemented are, for the cipher checks, it automatically exiting with 0, and for the lack ofargv[1]
, it's "expected output, not standard error of "/opt/sandbox50/bin/run.sh: line 31: 208..."
"
So, am I on the right track? Is there a function like isalpha
that works with strings? What exactly am I doing wrong?