/* main.c -- program to demonstrate use of a stack */ typedef struct stack * Stack; struct stack { void (*pushMethod)( Stack s, int i ); int (*popMethod)( Stack s ); struct stackElement * sp; }; /* constructor */ Stack newStack(); /* methods use the function pointers in struct stack */