I have this below code, that I have read:
look at line:Code:int solve(vector<string> digits){
string tmp="";
//do something with tmp
vector<int> D; for(unsigned i=0;i<tmp.size();++i) D.push_back(tmp[i]-'0');
}
I don't know, why tmp[i]-'0', not tmp[i]. Many people do this. But I don't know, why?Code:D.push_back(tmp[i]-'0');
So, who have experience, please give me.
thanks :)