i am having issues trying to figure out how to pass the address of my linked list that is stored inside my stack to a function.
void printreceipts(SNODE **StackTop)
{
if (*StackTop == NULL)
{
printf("No receipts\n");
}
else
{
/* I am supposed to use another function (ReturnAndFreeLinkedListNode(LNODE **, char [])) to traverse the linked list that is stored in my stack. it is also supposed to bring back one 'ticket' from the linked list in the Ticket variable */
char Ticket[5];
ReturnAndFreeLinkedListNode(StackTop->(*TicketList), Ticket);
pop(StackTop);
}
this is my typedef for my Stack,
typedef struct SNODE
{
int ReceiptNumber;
char *MovieTheaterName;
LNODE *TicketList;
struct SNODE *next_ptr;
}
SNODE;
I assume the Return function, Ticket variable, and pop function should all be in a while loop, but i am just so stuck..