I’ve been having this error with the stoi
function. Also, getTokenAt
returns a string, so this should be a problem.
struct Cliente
{
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 want 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.
2