1 2 3
A linked representation of a stack
#define OK -8888 #define STACKFULL -7777 #define STACKEMPTY -6666
typedef struct node* Nodeptr;
top:
typedef struct node { int data; Nodeptrnext; } Node;/* defining Node to be struct node */
void clearstack (Nodeptr*ptr) { while (*ptr != NULL) printf("%d\n", pop(ptr)); }