Er, ok, there are a lot of problems.
I found some of them, and it still doesn't work, so I'll let you to debug the rest.
First,
1 2 3 4
|
if ((input[j] != '+') ||
(input[j] != '-') ||
(input[j] != '*') ||
(input[j] != '/'))
|
is always true. You meant &&
second,
|
tempNumbers.push_back(input[j]);
|
input[j] has the value, for example, '0' which is decimal 48, hexadecimal 0x30.
You want the value you push back to be zero. You have to convert ASCII to decimal
by subtracting '0', or 0x30, or 48, whichever you like (I prefer the first).
third,
|
for (int k = 0; k < (tempNumbers.size() -1); k++)
|
this loop ignores the last character. you want k < tempNumbers.size(), not that - 1.
fourth,
|
tempResult += (tempNumbers[k] * 10);
|
that isn't mathematically right. you want tempResult = tempResult * 10;
fifth,
1 2 3 4
|
if (k == tempNumbers.back())
{
tempResult += (*tempNumbers.end() - 1);
}
|
you can't compare k to back(). k is an index. back() is a value in the vector. it doesn't make sense to compare them.
further, the += line has the same problem as in my original reply.
Sorry, this is as far as I got.