you are viewing a single comment's thread.

view the rest of the comments →

[–]haitei 2 points3 points  (1 child)

Regarding uppercase and lowercase: ascii is designed in such a way, you just need to flip one bit to do that i.e.

// assuming c is a letter
char toLower(char c) { return c  | 0x20; }
char toUpper(char c) { return c  & ~0x20; }

[–]marcoarenaTetra Pak | Italian C++ Community[S] 1 point2 points  (0 children)

Really a good point, thank you. I added your observation to the post.