Move line 9 after line 11. You're passing an empty string to the function, so bstring.lenght() == 0 and the loop is never executed. 'astack' is never filled. You probable want to put each character of the string in it.
----------
Next time please post details about your problem and any error you get.
@maeriden
I apologize and thanks because moving line 9 after 11 accommodates for a string value.
My real problem is how do I enter my string in such a way that it will compute it as a postfix.
No matter what way i enter a string it doesn't execute.
On line 37 you set the result of the operation that will then be returned on line 45. Except line 37 is executed only if bstring[i] is NOT an operation, but the if block containing it (line 23) is executed only if bstring[i] IS an operation.
You return the top of an empty stack, which causes undefined behavior.
I don't know why you get 0. When you enter the string, the >> operator reads the first word (should be "3") and puts it in 'astring'.
In the function the loop runs only one time (the length of "3" is 1), converts '3' to double and pushes it onto the stack. Then it is immediately returned.