stack tag

23 questions


1 answers
118 views
0
When I pop the stack code below, the value does not return properly.

#include <stdio.h>#include <stdlib.h>#define MAX_STACK_SIZE 5void stackFull() { fprintf(stderr, Stack is full, cannot add element); exit(1);}void stackEmpty() { fprintf(stderr, Stack is Em...

2 years ago

2 answers
104 views
0
Unhandled exception thrown: read access violation. top was nullptr.

What's the problem with the same error as the title?I'm going to watch it and follow it, but I don't know. #include <stdio.h>#include <stdlib.h>Typedef struct list {// The connection with ...

2 years ago

1 answers
106 views
0
I'm trying to convert the median to the posterior, but it's not working

#include <stdio.h>char stack[14] = ((9/2)*(4-2));int top = -1;void h_push(int in){ top++; stack[top] = in;}int h_pop(){ int out; out = stack[top]; top--; return out;}int main() { char inpu...

2 years ago
« - 3 -

© 2024 OneMinuteCode. All rights reserved.