2

The problem lies here: if(isdigit(argv[1][i] != true) You need to fully understand how isdigit() works, specifically the return value, and the numeric value of true. The is() family of functions all return an int. When true, each will return a different number that is a power of 2. This goes back to the history of programming and register values used in ...


2

Your return 1; will immediately end the program (ie, if the first character is a digit, your program will print success) so no further characters are checked. You should reverse how you are checking the characters ... if it's not a digit, then print the error and return; otherwise, keep checking and if you reach the very end of the loop without it stopping, ...


1

Program doesn't know if all the characters in key are digits until after it has processed all of them. The "Success" message should come after the for loop is finished. And remember this hint from the spec: Recall that we can return nonzero values from main to indicate that our program did not finish successfully. As soon as a non-digit is found, ...


1

You are meant to reject any number of command-line arguments other than one (means argc should be 2). To test whether a given character is numeric/alphabetic, you can use the isdigit/isalpha function (actually implemented as a macro, so mistakes in code might show up in weird ways), like if (isalpha(argv[1][j])). Or, test a range, like if (argv[1][j] >= '...


Only top voted, non community-wiki answers of a minimum length are eligible