Outputting a character from a stack outputs the ASCII instead
I put a + in a stack, and I'm trying to use cout to display stack.top(), which is the +, but it's outputting 43 instead.
This isn't my code, but it's essentially what I'm doing:
char ch = '+';
cout << myStack.top();
If I need to display my real code because the problem might lie elsewhere, then I don't mind
I'm also putting integers in my stack
because you use
as the template argument ?
int i = '+';
std::cout << i; // prints 43
Last edited on
Topic archived. No new replies allowed.