What I want to do is very very simple. Read through a string character by character and write the numbers to a separate string while including a space in between.
Ex. original string: "45+67-32" becomes "45 67 32"
Here's my logic:
while (i < line.length())
{
char c = line.at(i);
if (isdigit(c))
{
c = line.at(i);
while (isdigit(c) || c == '.' && i < line.size())
{
expression = expression + line.at(i);
i++;
}
expression = expression + ' ';
}
i++;
}