0

I uploaded my code in Gist so I avoid doing spoiler to those who have not finish yet. https://gist.github.com/anonymous/3b51071fe9d7226e9bdb43675290956a

My code is working mostly fine except some weird outputs sometimes. For example if use a key of 8 it will turn all the 'r' in an apostrophe and if I use a key of 7 it will turn the 's' in an apostrophe again. I really can't get what's wrong with my code! Thanks ahead for the help

1

Use 65 and 97, the ASCII values of 'A' and 'a', not 64 and 96.

Also, if you used any two of isalpha, islower, or isupper, non-letter could be an else path, with spaces and punctuation united.

And a last one: In C, if (value != 0) or if (value != NULL) or if (value != '\0') are same as if (value). It's fine if you want to emphasize the meaning of the null value.

But especially if the value represents a true/false value (0 is false, anything else is true), better not use != 0.

You must log in to answer this question.

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