else if (stringType == 2)
{
while (topValue != "(");
{
postFix.push_back(myStack.top());
if (!myStack.empty())
{
myStack.pop();
}
}
if (!myStack.empty())
{
myStack.pop();
}
std::cout<<"leaving 2"<< std::endl;
}
I'm getting an error right before it enters the while loop. I have a feeling its because I cannot make a comparison in such manner. Any clues on how to compare an element in a string to another element?
Post a compilable *short* code which reproduces the problem. There is a ton of missing information which could be the source of your problem.
Edit : Also use [code][/code] tags.