1 vote
Accepted

Pset2 vigenere: core dump - segmentation fault NEED HELP

The fact that k always seems to be 0 is a clue. According to the documentation for atoi(), it will return 0 when the given parameter (in this case, argv[1][i]) is not convertible to a number. The ...
  • 65.5k
1 vote
Accepted

Why is my vigenere cypher code resulting in "Segmentation fault: core dumped"?

if (argc!=2 || isalpha(argv[1])==0) isalpha() takes a single character as input. You're trying to stuff it with an entire string. Instant seg fault. Note that when argc!=2 is true, then the ...
  • 65.5k
1 vote

PSET2 Initiallizing - segmentation fault

You initialize string initial = NULL But in your 2nd for loop, you set n=strlen(initial)

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