I’ve been having this error with the function stoi. Also, getTokenAt returns a string, so this should be a problem.
{
int idCli;
int millas;
};
Cliente clienteFromString(string s)
{
char sep = 1;
Cliente x;
string t0 = getTokenAt(s,sep,0);
x.idCli=stoi(t0);
string t1 = getTokenAt(s,sep,1);
x.millas=stoi(t1);
return x;
}
If I use any other function that converts strings to integer it works, but not this one and I just wanted to know why.
New contributor
Fermin Sorzzoni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.