CS50-initials
So in continuing on with CS50 and PSET2, I’ve had my struggles with both initials and with caesar (cipher).
With the initials.c program it was setting the characters with s[i], and also making sure that I had the first character (characters == s[0] && i == 0), and then also checking for spaces (characters == ‘ ‘). This is because I thought all spaces/strings ended with ‘/0’, but apparently not. The other thing I found curious was that the C99 IDE gives me an issues when I try (int i = 0, n = strlen(s); i < n; i++), even though it works fine in the classroom. They keys here are to get the first character, and also to get the first character after a space (toupper(s[i+1])).
With Caesar that one presented more of a challenge because of the offset, and also, ensuring that the wrap was correct. I implemented it with wrap = (character + key - 26), in order to get it to work, but there is likely a better way. We are able to just print out anything that is punctuation or a space, which make it somewhat easier, and then have to go from there.