How can i convert a string of number (and i mean string not char ,because the atoi function works for char ,and didn't work for string for me) to an integer . I tried this but it didn't work :
int main(){
int P,W;
string ST1 , ST2;
getline(cin,ST1,' ');
getline(cin,ST2);
P = std::atoi(ST1);
W = std::atoi(ST1);
return 0 ;
}