The line:
ch[i] = (char)(ch[i] - 'a' + 'A');
Sets ch[i] to its associated uppercase due to a constant difference between an uppercase letter and its lowercase form.
For means of communication, the line can be re-written as:
ch[i] = (char)(ch[i] + ('A' - 'a'));
By adding this constant difference the line yields the lowercase letter’s uppercase character.
1
solved can someone please elaborate the following code?