With the help of stringstream a string can be converted into integer
int str2int (const string &str) {
stringstream ss(str);
int n;
ss >> n;
return n;
}
int str2int (const string &str) {
stringstream ss(str);
int n;
ss >> n;
return n;
}
No comments:
Post a Comment