the code compiles well ,, but an error ocures enter image description here

enter image description here


1 Answer 1


Your problem is isalpha(argv[1]) isalpha takes a single character as input. argv[1] is a string of multiple characters, not a character. You cannot apply isalpha to an entire string. It causes a seg fault.

If this answers your question, please accept this answer to remove the question from the unanswered question pool. Let's keep up on forum housekeeping. ;-)

  • would you be able to apply isalpha to something like argv[1][i], pinpointing the i'th character in argv[1]? @cliff May 15, 2017 at 22:17
  • Not only can you, but you should. Also, think "for loop" ;-)
    – Cliff B
    May 15, 2017 at 22:23

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