Hello guys, so Im a begginer and i study C++ in my school. So I have a homework that is about making a C++ program that calls function which fixes the first 2 letters of a string, and by fixing i mean if we insert a string that starts with 2 uppercase letters it makes the second one lowercase. Or if it starts with lowercase and the second one is upper makes the first upper and the second lower. By now I only could make and program that converts the whole string in uppercase, but i dont have an idea how to make the program check for upper or lower case.
So here is my code for all the string to upper case.
ASCII (American Standard Code for Information Interchange) is the most common format for text files in computers and on the Internet. In an ASCII file, each alphabetic, numeric, or special character is represented with a 7-bit binary number (a string of seven 0s or 1s). 128 possible characters are defined.
The trick is, if you assign a character into an integer variable, you will get its "index". Therefore, you may try to check (for example) if the first letter is within 65 -> 90 that means it's an upper case letter, and 97->122 is a lower case letter.
Convert from lower to upper by subtracting 27 and from upper to lower by adding 27.