E.g.
In C I\'d just subtract the char from \'A\', but I don\'t seem
The output you are expecting is just the offset of a upper case letter with respect to 'A'. So just subtract the Unicode value of 'A' from the unicode value of the letter whose offset is needed.
offset
'A'
example: 'B' - 'A' = 1
'B' - 'A' = 1