Why do you read a single character in first? Lines 19, 20:
1 2
char expression;
cin >> expression;
This is what's removing the 1st character (1). Line 30 cin >> value; then gets 2 as the first double value.
Side note. Is your program behaving OK on exit? Your Dstack destructor looks like it would cause an infinite loop or a crash:
1 2 3 4 5 6 7 8
Dstack::~Dstack()
{
Node *tmp;// never assigned a value
while ( m_head != NULL)// m_head isn't going to change here.
{
delete tmp;// delete what?
}
}
Perhaps you haven't had a problem yet if all nodes are already popped when your program exits. Do the same as you did in pop() except there's no need to involve value.