1
vote
Accepted
Indexing problem
I have tested your code, including the new code you've added in your edit, and your conditions work when the arithmetic is removed. This means changing capAlph[p] == text[i] - 'A' to capAlph[p] == ...
1
vote
Caesar problem: Validating keys
They are right, your program is only checking the first character of argv[1].
Try to think - your for loop checks the first character; if its not a digit, it throws an error and ends the program. Or ...
1
vote
Accepted
Caesar - Problem set 2 - incorrect output
As you know you've created a for loop that iterates once for each character introduced by the user of your program so, if you don't want to print printf("ciphertext: ......." for every character, you ...
1
vote
Get help in Pset2 Substitution
Is ouptut allocated correctly? It is declared here char output[strlen(i)]; as a char array, and used here printf ("ciphertext: %s\n", output); as a string. It is missing the "thing that makes a string ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
problemset2 × 8caesar × 4
readability × 2
substitution × 2
pset2 × 1
cs50x × 1
check50 × 1
segmentation-fault × 1
fails-check50-but-works × 1
pset2-caesar × 1
cipher-pset2 × 1
caesar-cipher × 1