Skip to content

Commit bbffdf7

Browse files
committed
fix: increase stack size
1 parent ff4aadb commit bbffdf7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

misc/postfix_evaluation.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* @brief array implementation of stack using structure
1919
*/
2020
struct Stack {
21-
int stack[10]; ///< array stack
21+
int stack[20]; ///< array stack
2222
int top; ///< stores index of the top element
2323
};
2424
struct Stack st; ///< global declaration of stack st
@@ -29,7 +29,7 @@ struct Stack st; ///< global declaration of stack st
2929
* @returns void
3030
*/
3131
void push(int8_t opd) {
32-
if(st.top == 9) { // overflow condition
32+
if(st.top == 19) { // overflow condition
3333
printf("Stack overflow...");
3434
exit(1);
3535
}

0 commit comments

Comments
 (0)