im had a similar problem as miromage did a few posts back, except my stack IS storing queues. i'm pushing null into the stack for some reason though. i didnt want to post the same problem, but after hours of trying i figured some help might be in order.
here are my two structs:
here is my queue being pushed onto the stackCode:struct queue { int* store; int count; int front; int back; int size; }; struct stack { struct queue* store; int top; int size; };
are there any other suggestions as to why the problem is still happening?Code:void push_queue(struct stack* s, struct queue* q) { if(s->top == s->size) expand_stack(s); s->store[s->top] = *q ; s->top++; printf("\n"); }