STRING TO INT doubt

Why are we using - ‘0’ while extracting last dig

a[n-1] is a character and you need its value so we subtract ‘0’ from it to get how far it is from character ‘0’