I have a function to get the top element from a stack...but I'm having a problem calling it
Code:
void stack::topElem(el_t& elem)
{
if(isEmpty())
{
stackError("stack is empty");
}
else
{
elem = el[top];
}
}
problem is I didn't write this the professor did...I would've just returned something but I have no idea what to put in the parameters. I though possibly this:
i
Code:
f ((let != '*') && (let != '+') && (let != '-') && (let != '/'))
{
thisStack.push(int(mystring[i]));
}
else
{
thisStack.pop(thisStack[thisStack.topElem(?????)]);
}
Those ??? symbolize my confusion. Any help would be appreciated....