I am not understnding how convert to int function is working

pls elaborateit in breif

Mention the timestamp in the video so that i can check what you are referring to

First refer this In convertToInt()
So by s[i]-‘0’ we extract the integer equivalent of each digit.
You have to convert the number into it integer equivalent. In a number there may be digits at ones place,at ten’s place and so on.
So p is the multiplication factor here.For the rightmost digit it will be 1. For the digit at ten’s place, it will be 10 and so on…
So by the line ans+=(( s[i] - ‘0’ ) * p ); you are actually converting the number in string to its integer equivalent. Dry run it with an example to understand well.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.