In the function convert to int

int ConvertToInt(string s)
int sum=0;
int p=1;
for(int i=s.length()-1;i>=0;i–)
{
sum+=((s[i]-‘0’)p);
p
=10;
}
return sum;
}

Here, what is the significance if subtracting ‘0’ from s[i];

hello @avichalguptajwr
we subtract ‘0’ from character digit to convert it to numric digit.
example if charater digit is ‘9’ then
’9’-‘0’ = 9.