int converToString(string s){
int ans = 0;
int p=1;
for( int i = s.length() -1; i >=0; i ++){
ans+=(( s[i] - ‘0’ ) * );
p= p * 10;
}
}
How is this code working.All this code does is convert string to numbers , i.e if we have 022 as string it will convert it to 22. and if we have 32 it will convert it into 32 only.
but how does it work, can you please explain it to me, role of variable p , this is don’t in "DESIGNING STRING TOKENISER " video .