I'm studying bit manipulation. My assignment is to write two functions. 1. convert string to all upper, 2. convert string to all lower. The trick is that I cannot use toupper or tolower. I have to use bit manipulation. I have read many articles and the chapters of various books on bitwise. It's very hard to find real world examples showing bit manipulation in C. Or at least I just don't know how to look for them.
What I know (or think I know)...
I understand that the easiest way to manipulate bits in C is to use hex. I have read and understand the basics of binary and hexadecimal. I understand that the difference between an uppercase character and a lowercase character is the 3rd lower order bit (I think). I understand how to create a mask to turn on and off this bit. But I just don't get how to get a char (getchar?), and manipulate a specific bit of that character using the mask.
Can anyone suggest a tutorial or provide any insight?