We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bdcee72 commit 0112928Copy full SHA for 0112928
chapter_5/exercise_5_10/expr.c
@@ -95,7 +95,7 @@ int main(int argc, char *argv[]) {
95
96
float pop(void) {
97
if (stack_pointer > 0) {
98
- return stack[stack_pointer--];
+ return stack[--stack_pointer];
99
}
100
101
printf("Error: the stack is empty.\n");
@@ -104,7 +104,7 @@ float pop(void) {
104
105
void push(float element) {
106
if (stack_pointer < STACK_SIZE) {
107
- stack[++stack_pointer] = element;
+ stack[stack_pointer++] = element;
108
} else {
109
printf("Error: the stack is full.\n");
110
0 commit comments