3

When encrypt[n] is declared, it doesn't allow for the end of string marker at the end. Also, the end of string marker is never added to the string, so when it is printed at the end of the program, garbage data following the string is also printed, until it finds random data that looks like the end of string marker. That answers your question, but there are ...


1

It looks like you left a debugging printf here printf("%c",curr_key);. The "thing" that is printing is a Unicode 1. And it's only printing when the key "resets" to 0. Since all the tests use b/B as the first character, the value of curr_key is always 1. The reason you do not see the extra characters when you run the program is because they are "non-...


1

Don't be scared by the number of errors, fixing them one by one quickly reduces the number. If you are unsure about how to use a feature, search it in the CS50 reference or on the internet. It's really annoying to see people like you not doing their search first. First error is about tolower not accepting strings. When you see something like that, look it ...


1

I see you're incrementing j at the end of every iteration of the for loop then decrementing it in case the current char is not alphabetical. well, you could increment it only when you need to, right? are you sure you wanna check whether key[p] is less than 26? also do you really have to do that every time either of the first two condition is true?


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