Assuming I have something like this
int temp;
string s = "5 + 6";
for (int i = 0; i < s.length(); i++)
{
if (isdigit(str[i]))
{
temp += stof(str[i],0);
}
}
How do I use stof so that I can access different positions of str and store it?
Aucun commentaire:
Enregistrer un commentaire