Trust you are well, I apologize for asking a question that's been asked before but I've been stuck on this for a while without any luck and finally realized I need help.

I've attached my code of CS50 Caeser (Validating the key), how do I iterate through Isdigit in a string and not just a single character? I've tried using isalpha and ascii before isdigit but still not getting it right? Is my logic for validating the key right? Or is there another approach for completing ceaser? surely if you iterate through a string with isdigit and compile ceaser 20x it should print "Usage: ./caesar key" ? Please i'd appreciate any help.

Thank You in advanceenter image description here

1 Answer 1


There is an issue with your for loop.

You need to put the if statement in a {} and intent it.

There is also something odd with the sintax of the for statement.

Check out https://www.tutorialspoint.com/cprogramming/c_for_loop.htm

If this answered your question place mark your question as answered.

  • Thank you for your reply I appreciate the help, helped me to understand and fix it Apr 30, 2020 at 6:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .