code is showing error kindly rectify the code
Infix to postfix stack
hello @shabadsingh
what error u r getting?
also if possible share the link of question where u r submit this
@aman212yadav it is not running on compiler i am just practicing this question it is not running on any compiler showing error
source.cpp: In function ‘char* intToPost(char*)’:
source.cpp:40:30: error: void value not ignored as it ought to be
40 | post[j]=s.pop();
| ~~~~~^~
source.cpp:46:22: error: void value not ignored as it ought to be
46 | post[j]=s.pop();
s.pop() returns nothing thats why it is showing error.
replace this line with
post[j]=s.top();
s.pop();
check whether stack is empty or not. if it is not empty thrn only check for this condition
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.